mercoledì 16 aprile 2008

R installing on Unix/Linux - no root access

Thanks and credit to Joern Toedling for this useful and clear how-to!

From The Bioconductor Digest, Vol 62, Issue 14:
You do not need to have root access to a machine to install your own
versions of R and your favourite packages there. This is how to do it:
1. downloaded the tar.gz of the development version of R from
2. uncompress it to a directory you have write access to, say ~/local/R
3. change into the uncompressed directory, ~/local/R/R-devel
4. run "./configure"
5. run "make"
Afterwards you can start R by executing ~/local/R/R-devel/bin/R;
to simplify that either add the bin directory to your path or create an alias for R
You do not need to run "make install" to work with R.
For packages,
1. create a directory in which you want the packages installed, e.g. ~/local/rpacks
2. create an evironment variable R_LIBS that holds the path to that directory, e.g. "setenv R_LIBS=${HOME}/local/rpacks" with that directory and a C-shell (use export with a Bash shell)
This environment variable tells R where to look first for installed packages and where to install packages when using "install.packages" or "biocLite".
R_LIBS is safe to use, since it only extends the path to look for packages and does not replace the default R library path.
I would recommend to add the alias for starting R and the R_LIBS
definition to your shell startup file (~/.cshrc or ~/.bashrc).

9 commenti:

  1. you can also use
    ./configure --prefix=/home/user
    to install R without root privileges.

  2. Thanks for the useful addendum!

  3. It is giving me error -
    configure: error: No F77 compiler found
    Any idea what I can do

  4. The easy way requires root access and on a debian/Ubuntu based distribution can be accomplished as described at this link :
    Installing the f77 compiler as simple user can be a real pain in the a**!

  5. Is that any other way I can install R. Which do not require any compiler intervention.

  6. You should take a look at . You'll find precompiled binaries for the three major OS and a lot of information about the installation and use of R. is an other good resource: remember to use [r] tag to select answer related to the R programming language.

  7. Thanks for the tip! However, it dosn't work for me. I get an error during "configure" and then can't run "make".
    The Error I get during "./configure":

    "configure: error: --with-x=yes (default) and X11 headers/libs are not available"

    The Error I get during make:

    "make: *** No targets specified and no makefile found. Stop"

    The system running on our servers is Red Hat Linux. I can't find any precompiled binaries for this on the cran website (the respective lonk leads to an empty directory)

    Any suggestions on how I can get R running here?

  8. This is a very old tip and I did all my installation either on debian-like Linux or (old) Mac OS X. In any case from the error output it seems you should install a compiler in your system and this can very easily done by a root user but it is a pain in the a** if your are a basic user.