How to avoid the following NOTE that is appearing in R CMD check with the new R development version ( R Under development (unstable) (2017-02-15 r72179))?

• checking for unstated dependencies in examples ... OK
• checking line endings in C/C++/Fortran sources/headers ... OK
• checking compiled code ... NOTE
File ‘pkgname/libs/pkgname.so’:
  Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols’

It is good practice to register native routines and to disable symbol
search.

For example in Hmisc

推荐答案

The message is somewhat arcane. I looked around also in other packages and I found that the useDynLib(packagename) in the NAMESPACE file was replaced by useDynLib(packagename, .registration = TRUE).

In addition, I added a .c file, named registerDynamicSymbol in the src/ directory with the following code:

// RegisteringDynamic Symbols

#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>

void R_init_markovchain(DllInfo* info) {
  R_registerRoutines(info, NULL, NULL, NULL, NULL);
  R_useDynamicSymbols(info, TRUE);
}

I took this suggestion from GitHub Rcpp. The canonical reference is in Writing R Extensions

Also R Devel Mailinglist provided supplementary infos.

UPDATE

The most direct straightforward approach is:

  1. use the current R Development Version (that will eventually become 3.4)
  2. Run the tools::package_native_routine_registration_skeleton(".") and copy and paste the full output in a packagename_init.c file to be put in src/
  3. update NAMESPACE, verifying that useDynLib(packagename, .registration = TRUE)
  4. If necessary, replace the exportPattern with export( list of object to be exported )

UPDATE 18th July

As noted by @Symbolix using the most recent version of R and RStudio's devtools the point 2. (init.c files) appears handled by either devtools (using RStudio check digit) or tools packages.

R相关问答推荐

使用Shiny组合和显示复制和粘贴的数据

从R中的另一个包扩展S3类的正确方法是什么

列出用m n个值替换来绘制n个数字的所有方法(i.o.w.:R中大小为n的集合的所有划分为m个不同子集)

按R中的组查找相邻列的行累积和的最大值

在R中列表的结尾添加数字载体

如何在kableextra调用cell_spec()中忽略NA?

在R中使用数据集名称

制作等距离的线串副本

如何使用列表中多个列表中的第一条记录创建数据框

将文件保存到新文件夹时,切换r设置以不必创建目录

根据类别合并(汇总)某些行

根据现有列的名称和字符串的存在进行变异以创建多个新列

更新R中的数据表(使用data.table)

有没有办法通过str_Detect()或其他字符串匹配函数来连接两个长度不等的数据帧?

如何显示准确的p值而不是<;0.001*?

TidyVerse中长度不等的列结合向量

roxygen2正在处理太多的文件

图中显示错误 colored颜色 的图例geom_sf

GgHighlight找不到它创建的列:`Highlight..1`->;`Highlight.....`

使用相对风险回归计算RR