现在的位置: 首页 > 综合 > 正文

如何在linux环境下安装R包

2012年11月26日 ⁄ 综合 ⁄ 共 769字 ⁄ 字号 评论关闭
Then Install BioConductor PackagesRight now, the easiest way to install BioConductor packages is using the biocLite.R installation script. Here's how to use it: 
In an R command window, type the following:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
source(">

将包下载下来,在命令行下:
>R CMD INSTALL -l 你要安装的目录 *.gz(你的包的)

我的方法是:
把包下载到本地
>install.packages("package_path",repos=NULL)

Commands:
INSTALL Install add-on packages
Please use 'R CMD command --help' to obtain further information about
the usage of 'command'.

建议还是用这个稳妥些。
source("http://www.bioconductor.org/biocLite.R")
biocLite(c("pkg1", "pkg2")) 
#Where "pkg1" and "pkg2" are the names of the packages you would like to install.

因为R package涉及到R本身版本高低,已安装的依赖包的版本的高低,辛苦
down下来包包可能根本不匹配,也就用不了。biocLite脚本能够自动处理这些,保证安装的package可用。
R CMD是很cool的命令。但犯linux的通病,复杂的依赖关系。
而biocLite就非常像FC6 linux下的yum,只要网路好,这种安装无疑是省体力的。

抱歉!评论已关闭.