R devtools::install()可以工作,但devtools::check()不能
我正在测试一个R包(称为“TRIMmaps”),并运行R devtools::install()可以工作,但devtools::check()不能,r,devtools,R,Devtools,我正在测试一个R包(称为“TRIMmaps”),并运行devtools::check()。检查“检查是否可以安装程序包“TRIMmaps”失败。在日志文件中,我找到了以下信息: 在00check.log中 * using log directory ‘/tmp/RtmpsnrErp/TRIMmaps.Rcheck’ * using R version 3.4.4 (2018-03-15) * using platform: x86_64-pc-linux-gnu (64-bit) * using
devtools::check()
。检查“检查是否可以安装程序包“TRIMmaps”失败。在日志文件中,我找到了以下信息:
在00check.log中
* using log directory ‘/tmp/RtmpsnrErp/TRIMmaps.Rcheck’
* using R version 3.4.4 (2018-03-15)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* using options ‘--no-manual --as-cran’
* checking for file ‘TRIMmaps/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘TRIMmaps’ version ‘1.14-0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘TRIMmaps’ can be installed ... ERROR
Installation failed.
See ‘/tmp/RtmpsnrErp/TRIMmaps.Rcheck/00install.out’ for details.
* DONE
…和in 00install.out:
* installing *source* package ‘TRIMmaps’ ...
** R
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘lattice’
ERROR: lazy loading failed for package ‘TRIMmaps’
* removing ‘/tmp/RtmpsnrErp/TRIMmaps.Rcheck/TRIMmaps’
*正在安装*源代码*包“TRIMmaps”。。。
**R
**仪表
**为延迟加载准备包
loadNamespace中出错(j您有多个库吗?默认库是什么?安装在哪个库中的是lattice
。libpath()
可能有用。@Gregor:是的,我有多个库。这怎么会导致问题?@Gregor:实际上lattice
安装在我的默认库中(第一个显示在.libPaths()
)中。可能将该信息编辑到您的问题中。这是相关的,编辑您的问题(与评论不同)会将其推到“活动”队列的顶部。我发现了问题的根源:缺少的包安装在我的个人库中,第一个由.libPaths()列出。devtools::install()似乎使用了这个库,因此安装我的包没有问题。但是,devtools::check()需要将所有包安装在/usr/local/lib/R/site library中,这是由.libpath()显示的第二个库。我在这个库中安装了所有包(lattice和其他一些包),之后devtools::check()工作正常。