Rcpp Rcpp.package.skeleton("mypackage") "rcpp_hello_world";不适用于包“mypackage"的 .Call(); [英] Rcpp Rcpp.package.skeleton("mypackage") "rcpp_hello_world" not available for .Call() for package "mypackage"
问题描述
我已经在 R 提示符下通过以下命令成功地将 Rcpp.package.skeleton
安装到 Windows 中 -
I've managed to get the Rcpp.package.skeleton
to INSTALL in Windows by the following commands at the R prompt -
Rcpp.package.skeleton("mypackage")
system("R CMD build mypackage")
system("R CMD INSTALL mypackage")
library(mypackage)
这将创建 mypackage.dll
.但是,当我执行以下命令时 -
This creates the mypackage.dll
. However when I do the following commands -
rcpp_hello_world <- function(){ .Call( "rcpp_hello_world", PACKAGE = "mypackage")}
rcpp_hello_world()
我收到以下错误:
Error in .Call("rcpp_hello_world", PACKAGE = "mypackage") :
"rcpp_hello_world" not available for .Call() for package "mypackage"
我运行 sessionInfo()
并得到以下信息:
I run sessionInfo()
and I get the following:
attached base packages:
[1] tools stats graphics grDevices utils datasets methods base
other attached packages:
[1] mypackage_1.0 inline_0.3.13 Rcpp_0.11.1
说明我的新 mypackage 在那里.
Stating that my new mypackage is there.
我还能做进一步的检查以了解发生了什么吗?有什么想法吗?
Are there any further checks I can do to see what is happening? Any ideas?
推荐答案
FWIW,我在用 Rcpp 改造现有的 R-only 包时遇到了类似的错误,问题是缺少 useDynLib(mypackage)
在 NAMESPACE
中.
FWIW, I just got a similar error while retrofitting an existing R-only package with Rcpp, and the problem was a missing useDynLib(mypackage)
in NAMESPACE
.
这篇关于Rcpp Rcpp.package.skeleton("mypackage") "rcpp_hello_world";不适用于包“mypackage"的 .Call();的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!