外部函数调用R中的基本包

时间:2014-11-05 22:56:01

标签: r

我正在编写一个新的R函数,它使用cor函数的修改版本(即cor2),为此我使用了本机cor函数的裸骨。在原始代码中,在包统计中调用C_cor函数。我尝试运行cor2函数,但是我收到以下错误:

Error: object 'C_cor' not found

我从

修改了对编译函数的调用

.Call(C_cor, x2, y2, 1L, method == 'kendall')

.Call(stats:::C_cor, x2, y2, 1L, method == 'kendall')

之后一切正常。

当我尝试R CMD check命令来验证我正在努力的包时,我得到:

* checking dependencies in R code ... NOTE
Unexported object imported by a ':::' call: ‘stats:::C_cor’
  See the note in ?`:::` about the use of this operator.
See the information on DESCRIPTION files in the chapter ‘Creating R
packages’ of the ‘Writing R Extensions’ manual.

和:

* checking foreign function calls ... WARNING
Foreign function call to a base package:
  .Call(stats:::C_cor, ...)
Packages should not make .C/.Call/.External/.Fortran calls to a base
package. They are not part of the API, for use only by R itself and
subject to change without notice.

我阅读了“写作扩展”手册,但我无法解决问题。我还试图在Uwe Ligge的建议中找到stats包中的C_cor函数(来自新的R下载),但我还没有找到它。我阅读了here之前的讨论,但我仍然没有找到解决问题的方法。

您对如何通过R CMD检查克服NOTE和WARNING有任何建议吗?

一切顺利

0 个答案:

没有答案
相关问题