简体   繁体   English

如何在Linux集群中安装R软件包

[英]How to install R packages in Linux cluster

I got cluster account from my college, and got installed R 2.13.0 in linux cluster(redhat 2.6.18-128.el5) but I'm not able to install r packages. 我从我的大学获得集群帐户,并在Linux集群(redhat 2.6.18-128.el5)中安装了R 2.13.0,但是我无法安装r软件包。 I tried the following codes 我尝试了以下代码

  1. install.packages('plyr') and I selected the CRAN mirror as 1. then I got the following msg. install.packages('plyr')然后选择CRAN镜像为1,然后得到以下消息。

Warning: unable to access index for repository http://cran.ms.unimelb.edu.au/src/contrib Warning messages: 1: In open.connection(con, "r") : unable to resolve 'cran.r-project.org' 2: In getDependencies(pkgs, dependencies, available, lib) : package 'plyr' is not available (for R version 2.13.0) 警告:无法访问存储库http://cran.ms.unimelb.edu.au/src/contrib的索引警告消息:1:在open.connection(con,“ r”)中:无法解析'cran.r- project.org'2:在getDependencies(pkgs,dependencies,available,lib)中:包'plyr'不可用(对于R版本2.13.0)

  1. now I made a local lib and tried 现在我做了一个本地库,并尝试

     mkdir ~/R_libs install.packages("lattice",repos="http://cran.r-project.org", lib="~/R_libs/") 

then again warning 然后再次警告

Warning: unable to access index for repository http://cran.r-project.org/src/contrib Warning message: In getDependencies(pkgs, dependencies, available, lib) : package 'lattice' is not available (for R version 2.13.0) 警告:无法访问存储库http://cran.r-project.org/src/contrib的索引警告消息:在getDependencies(pkgs,dependencies,available,lib)中:包'lattice'不可用(对于R版本2.13) .0)

I downloaded packages, and uploaded into the cluster. 我下载了软件包,然后上传到集群中。 is it possible to install from that?? 可以从那里安装吗?

I don't have any sudoers rights(Administrator privileges). 我没有任何sudoers权限(管理员权限)。 cluster is having 32 nodes. 群集具有32个节点。

Edit: I uploaded car_2.1-0.zip to the cluster and tried the bellow code. 编辑:我将car_2.1-0.zip上传到集群并尝试了以下代码。

R CMD INSTALL car_2.1-0.zip -l /R_libs

but I got the response as shown below 但是我得到了如下所示的响应

Error in rawToChar(block[seq_len(ns)]) : embedded nul in string: 'PK\\003\\004\\n\\0\\0\\0\\0\\0\\xef3ZG\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\004\\0\\0\\0car/PK\\003\\004\\024\\0\\002\\0\\b\\0\\xe03ZGn\\xaa\\xf3\\x90Q\\001\\0\\0\\xa2\\002\\0\\0\\f\\0\\0\\0car/CITATION\\x9dR\\xc1j\\0021\\020=W\\xf0\\037\\x86=\\xed\\x82\\xec\\xd6\\036\\x85\\036\\xb6b)E' rawToChar(block [seq_len(ns)])中的错误:字符串中嵌入了nul:'PK \\ 003 \\ 004 \\ n \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ xef3ZG \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 004 \\ 0 \\ 0 \\ 0汽车/ PK \\ 003 \\ 004 \\ 024 \\ 0 \\ 002 \\ 0 \\ b \\ 0 \\ xe03ZGn \\ xaa \\ xf3 \\ x90Q \\ 001 \\ 0 \\ 0 \\ xa2 \\ 002 \\ 0 \\ 0 \\ f \\ 0 \\ 0 \\ 0汽车/城市\\ x9dR \\ xc1j \\ 0021 \\ 020 = W \\ xf0 \\ 037 \\ x86 = \\ xed \\ x82 \\ xec \\ xd6 \\ 036 \\ x85 \\ 036 \\ xb6b)E'

Is there any way to overcome this?? 有什么办法可以克服吗? Thanks 谢谢

Thank you so much for providing the details for my question as comment. 非常感谢您提供我的问题的详细信息作为评论。 Let me conclude all those information here. 让我在这里总结所有这些信息。

Instead of begging to your system admin, it's better to follow the following procedure 与其乞求您的系统管理员,不如遵循以下步骤

Step 1: download latest version of R from the following link : https://cran.r-project.org/sources.html(i downloaded R-3.2.2) 步骤1:从以下链接下载R的最新版本: https : //cran.r-project.org/sources.html(我下载了R-3.2.2)

Step 2: upload it into your cluster(I'm using WinSCP in windows 8.1) 步骤2:将其上传到您的群集中(我在Windows 8.1中使用WinSCP)

Step 3: unpack it using the following command tar -xf Rx.yztar.gz 步骤3:使用以下命令将其解压缩tar -xf Rx.yztar.gz

in my case its tar -xf R-3.2.2.tar.gz 在我的情况下,它的tar -xf R-3.2.2.tar.gz

Step 4: go to that directory using the code cd R-3.2.2 步骤4:使用代码cd R-3.2.2转到该目录

Step 5: type ./configure or ./configure --enable-R-shlib && make 步骤5:键入./configure或./configure --enable-R-shlib && make

Step 6: after the completion of config, type make 步骤6:完成配置后,键入make

Step 7: Then check the built system works correctly by make check 步骤7:然后通过make check构建的系统是否正常工作

Enjoy!!! 请享用!!!

module load R

(say this is the R on the cluster, so now it is on your path and you can enter it by typing R) (例如,这是集群上的R,因此现在它在您的路径上,您可以通过键入R来输入它)

export R_LIBS_USER=$HOME/apps/R:$R_LIBS_USER

(you are still on the Linux commandline, not in R yet) (您仍在Linux命令行上,尚未在R中)

R

(now you enter R) (现在输入R)

install.packages("packagename")

Well done, it will install the package to HOME/apps/R 做得好,它将软件包安装到HOME / apps / R

library(packagename)

(Try it and see it worked) (尝试一下,看看效果如何)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM