我想创建一个包含RcppArmadillo函数的包:
library(Rcpp)
library(RcppArmadillo)
sourceCpp("calculSignSim.cpp")
RcppArmadillo.package.skeleton(name = "calculSignSimCPP",list = "calculSignSim")
sourceCpp
创建的函数运行正常。
但是,后一行给出了以下错误:
Calling package.skeleton to create basic package.
Creating directories ...
Creating DESCRIPTION ...
Creating NAMESPACE ...
Creating Read-and-delete-me ...
Saving functions and data ...
Making help files ...
Done.
Further steps are described in './calculSignSimCPP/Read-and-delete-me'.
Adding RcppArmadillo settings
>> added Imports: Rcpp
>> added LinkingTo: Rcpp, RcppArmadillo
>> added useDynLib and importFrom directives to NAMESPACE
>> added Makevars file with Rcpp settings
>> added Makevars.win file with RcppArmadillo settings
>> added example src file using armadillo classes
>> added example Rd file for using armadillo classes
Error in Rcpp::compileAttributes(root) :
Evaluation error: D:/R packages/calculSignSimCPP/R/calculSignSim.R:3:21: unexpected '<'
2: function (lemmesV, ulemmesV, optionLien)
3: .Primitive(".Call")(<
^.
In addition: Warning message:
In dump(item, file = file.path(code_dir, sprintf("%s.R", list0[item])), :
deparse may be incomplete
我真的不明白为什么它不起作用。
当我没有明确指出我想要包含哪个功能时,即当我
时RcppArmadillo.package.skeleton(name = "calculSignSimCPP")
一切正常,但创建的包不包含我的功能......
有什么想法吗?