“找不到对象”;在软件包构建/安装过程中 [英] "object not found" during package build/install
问题描述
我不知道要调试构建/安装软件包。通过
I'm at a loss to debug building/installing a package. Building a package "MyProjekt" through
> devtools::build("MyProjekt")
工作正常,即使
> devtools::document()
Updating MyProjekt documentation
Loading MyProjekt
Error: object 'rank' not found whilst loading namespace 'MyProjekt'
失败。
尝试安装内置的(纯R)软件包
Attempting to install the built (pure R) package
> install.packages(pkgs="./MyProjekt.tar.gz")
...
Error: package or namespace load failed for 'MyProjekt':
object 'rank' not found whilst loading namespace 'MyProjekt'
Error: loading failed
Execution halted
...
ERROR: loading failed for 'i386', 'x64'
也会失败。
不幸的是,术语等级是我的域名,当我在该文件中搜索该词时,我会受到数百次点击。
Unfortunately the term 'rank' is a common term in my domain and I have hundreds of hits when searching in my files for that term.
我应该如何开始系统地寻找该错误的原因?
How might I start a systematic way to hunt this bug down?
推荐答案
该工具链在NAMESPACE文件中错误地生成了S3method(...)。
The toolchain mistakenly generates S3method(...) in the NAMESPACE file.
请遵循此答案并手动编辑NAMESPACE文件。将 S3方法(f)
的出现替换为 export(f)
。
Follow this answer and edit the NAMESPACE file by hand. Replace occurrences of S3method(f)
with export(f)
.
我不确定这是可重复的。生成的文件似乎不仅要写入,而且还要在后续的软件包构建过程中读取(由devtools?由roxygen2?提供)。如果这对您不起作用,请添加您的评论。
I'm not certain this is repeatable. The generated files appear to be not just written, but also read during a subsequent package build (by devtools? by roxygen2?). Add your comments if this works/does not work for you.
这篇关于“找不到对象”;在软件包构建/安装过程中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!