在linux 服务器上安装R 分析包,总会遇见很多错误!在windows下安装通常会比较顺利!总结了一套通过window 安装linux R 分析包的经验,共享给大家。
比如安装R 的 clusterProfiler 分析包,使用命令BiocManager::install("clusterProfiler")报错信息如下:
ERROR: compilation failed for package ‘systemfonts’
ERROR: dependency ‘systemfonts’ is not available for package ‘ggforce’
ERROR: dependency ‘ggforce’ is not available for package ‘ggraph’
ERROR: dependency ‘ggforce’ is not available for package ‘scatterpie’
ERROR: dependencies ‘ggraph’, ‘scatterpie’ are not available for package ‘enrichplot’
可以在window安装同一版本的R软件,安装好clusterProfiler后,找到包的安装路径,把依赖的包直接拷贝到linux lib目录下:
举例:
window:D:/software/R-4.2.0/library
拷贝到linux 服务器:/usr/anaconda/envs/R.4.2.0/lib/R/library
进入linux 服务器:
library(clusterProfiler)
如果报错,可以单独安装缺少或者损坏的包
如我遇到的错误:
shared object ‘ggraph.so’ not found
解决方法:
BiocManager::install("ggraph",force=TRUE)
ggforce.rdb is corrupt
解决方法:
重启R
再进入就可以了

网友评论