【发布时间】:2019-02-03 12:17:35
【问题描述】:
我正在尝试使用 roxygen2 将文档添加到我的任意 Rcpp 包中,但我不断收到相同的错误消息
> roxygen2::roxygenise("anRpackage")
First time using roxygen2. Upgrading automatically...
Error in .f(.x[[i]], ...) : attempt to apply non-function
In addition: Warning message:
roxygen2 requires Encoding: UTF-8
我的源代码中没有“.f(.x[[i]])”,而且我无法识别“.f”形式。这是某种隐藏功能吗?我应该如何调试这个错误?我对编写 R 包很陌生,也许我遗漏了一些东西....提前致谢!
library(Rcpp)
library(RcppArmadillo)
library(roxygen2)
sessionInfo()
输出如下:
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] roxygen2_6.1.0 RcppArmadillo_0.9.100.5.0 Rcpp_0.12.18
loaded via a namespace (and not attached):
[1] compiler_3.4.2 R6_2.2.2 magrittr_1.5 tools_3.4.2 yaml_2.1.14
[6] xml2_1.1.1 stringi_1.1.6 stringr_1.2.0 commonmark_1.4
【问题讨论】:
-
您能否分享一下存储库或提供minimally complete verifiable example ?
-
我刚试过你的命令序列:
RcppArmadillo::RcppArmadillo.package.skeleton(); Rcpp::compileAttributes("anRpackage"); roxygen2::roxygenise("anRpackage");。这里没有错误消息。 -
与Ralf Stubner 一样,我也运行了该命令序列,但没有收到任何错误消息。您可以运行以下命令并编辑您的问题以包含输出吗?
library(Rcpp); library(RcppArmadillo); library(roxygen2); sessionInfo() -
@lollipop R 版本,Rcpp、RcppArmadillo 和 roxygen2 版本,操作系统类型......
-
@lollipop 只包含
sessionInfo()的完整输出。那真的很有帮助...