简体   繁体   中英

How to install R on a linux cluster?

I use a cluster (OS is Linux) which does not have R. I would like to install R in my personal folders so that I can just do

Rscript example.R arg1 arg2

How should I install R on this cluster knowing that I don't have admin rights?

How can I then manage the packages?

I'm not sure this is on-topic, but: all you really have to do is

  • download the R source tarball from CRAN; unpack it somewhere in your file space
  • create an r-build directory at the same level of the hierarchy (not technically necessary, but it's better practice to keep the source and build directories separate)
  • create an installation directory (say ~/r_install ) somewhere sensible within your file space
  • cd to the source directory; tools/rsync-recommended
  • cd to the build directory
  • ../[srcdir]/configure --prefix=~/r_install
  • make (to build the binaries)
  • make install (to move everything where it belongs; not technically necessary, as you can run R from the build directory)

Where this may get hairy is with all of the system requirements for R (LaTeX, Java, bzip2, etc. etc. ...) it is theoretically possible to download all this stuff and install it in your own file space, but it starts to get sufficiently tedious that it will be easier to beg your sysadmin to install at least the dependencies for you ...

as @Hack-R points out the basics of this answer are already present on Unix & Linux stackexchange , although my answer is a little more detailed ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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