Installing R locally without root privileges
If you are running on linux and want to make a local installation of R without sudo rights, here are the steps you should follow…
- Download a copy of the tar.gz version of R from CRAN to your home directory.
- Uncompress the file.
- Run the usual configure + make commands with the prefix options since you do not have root permissions.
- For simplicity, create an alias in your .csrc file that links to the newly installed R version.
- That’s it! All done!
cd /home/myname tar -xvf R-version.tar.gz
cd /home/myname/R-version ./configure --prefix=/home/myname make
alias R /home/myname/R-version/bin/R
Creating a local library to install R packages
- In your R installation directory (this doesn’t have to be the case, in fact it can be anywhere!), create a new directory where you want all packages to be installed.
- Add a new library environment in your .cshrc file.
- That should work, when you use the command,
the package should be installed in /home/myname/R-version/mylibrary.
cd /home/myname/R-version mkdir mylibrary
setenv R_LIBS /home/myname/R-version/mylibrary