Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
358 views
in Technique[技术] by (71.8m points)

Manually Downloading and Installing Packages in R

I am currently trying to run some R code on a computing cluster but cannot run the install.packages function due to some weird firewall settings on my cluster. Since I am only using a few packages in my R code, I was hoping to avoid using the install.packages function by downloading and installing the packages manually.

Note: I am aware that there is a way to avoid this issue by using an HTTP proxy as described in the R FAQ. Unfortunately the people in charge of my cluster are not being helpful in setting this up so I'm forced to consider this alternative approach.

Ideally, I would like to download the packages files from CRAN to my computer, then upload these files to the cluster and install them using the appropriate commands in R. In addition, I would also like to make sure that the packages are installed to a location of my choice since I do not have the permission to "write" in the default R directory (I believe that I can do this within R by using the .libPaths function)

Lastly, the computers that I am working with on the cluster are Unix x86_64.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can install the package manually using the following command

install.packages('package.zip', lib='destination_directory',repos = NULL)

See the help of ?install.packages, for further description


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...