[英]error with R CMD check because of package dependency
I am creating a newpackage that depends on oldpackage , and have indicated this dependency in the file newpackage/DESCRIPTION
. 我创建取决于oldpackage一个newpackage,并表示在文件这种依赖
newpackage/DESCRIPTION
。
Furthermore, 此外,
oldpackage is installed in the directory, ~/lib/R
oldpackage安装在目录
~/lib/R
my .Rprofile
includes .libPaths("~/lib/R")
我的
.Rprofile
包含.libPaths("~/lib/R")
library(oldpackage)
in R library(oldpackage)
Despite the ability to load the package without having its library specified, R CMD check newpackage
gives an error indicating that it can not fine oldpackage : 尽管能够在没有指定库的情况下加载包,但是
R CMD check newpackage
会给出一个错误,表明它不能很好地解决oldpackage :
checking whether the package can be loaded ... ERROR
Loading required package: oldpackage
Error: package 'oldpackage' could not be loaded
In addition: Warning message:
In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) :
there is no package called 'oldpackage'
Execution halted
It looks like this package has a loading problem: see the messages for
details.
Why is R unable to find the package? 为什么R无法找到包裹?
Can I specify the library location in the DESCRIPTION file? 我可以在DESCRIPTION文件中指定库位置吗?
Regarding question 1), it is both a FAQ and yet somewhat annoying. 关于问题1),它既是常见问题,又有点烦人。
R CMD check
runs in vanilla mode, so it will not find user-level libraries. R CMD check
以vanilla模式运行,因此无法找到用户级库。 As I recall, setting R_LIBS="...." in the call helps, so try that. 我记得,在通话中设置R_LIBS =“....”有帮助,所以试试吧。
Regarding question 2), no you cannot give a location in DESCRIPTION. 关于问题2),不,你不能在DESCRIPTION中给出一个位置。 Which makes sense as that file needs to work 'everywhere' whereas your location info is local to your machine.
这有意义,因为该文件需要“随处”工作,而您的位置信息是您的机器的本地信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.