装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status

帮小师妹跨操作系统安装一个R包叫devtools,

cran上只有Windows和OS

情况如下:

在本机上可以安装(Windows)

但是在超算平台上无法安装,平台系统为red hat(基于Linux)

给出的error为

Installing package into ‘~:/path/’
(as ‘lib’ is unspecified)

以及installation of package had non-zero exit status

解决办法如下:

下文均在中执行

在本地(自己电脑安装好该包)和服务器的Rstudio中

运行

(.libPaths())

根据本地Rstudio给出的路径找到该包。将整个文件夹copy到Linux平台的路径下

刷新Rstudio

执行

library(devtools)

 OK

装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status_第1张图片

感觉这是一个万能的方法,欢迎交流!

 

转载于:https://www.cnblogs.com/super-yb/p/11032956.html

你可能感兴趣的:(装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status)