【发布时间】:2018-07-19 16:13:24
【问题描述】:
这是我的脚本
library(Rcpp)
library(inline)
myroot2 <- rcpp(signature(xs="numeric"), body='double x=as<double>(xs); return wrap(::sqrt(x));')
print(myroot2(100))
如果我从 R 获取这个脚本,它运行得很好
>source('test.R')
Attaching package: ‘inline’
The following object is masked from ‘package:Rcpp’:
registerPlugin
[1] 10
在批处理模式下
Rscript --verbose test.R
running
'/usr/local/share/bcbio/anaconda/lib/R/bin/R --slave --no-restore --
file=test.R'
Attaching package: ‘inline’
The following object is masked from ‘package:Rcpp’:
registerPlugin
Error in signature(xs = "numeric") : could not find function
"signature"
Calls: rcpp -> cxxfunction
Execution halted
如何解决这个问题?
【问题讨论】: