[R] install R in relative path

Martin Maechler maechler at stat.math.ethz.ch
Wed Oct 19 10:37:59 CEST 2016

>>>>> Tom Graves via R-help <r-help at r-project.org>
>>>>>     on Tue, 18 Oct 2016 21:06:54 +0000 writes:

    > Hello everyone, I am trying to figure out if I can install
    > R in a relative path?

Yes.   Even better you don't have to "install" it at all in the
strict sense.
Just *build* it and run it from the build directory.

If you use the source tarball 
currently,  R-3.3.1.tar.gz,  in 12 days will be R-3.2.2.tar.gz

Let's assume you'd want everything in your


Then you do


cd ~/R-inst
tar xfz <whereever>/R-3.3.1.tar.gz
    # now has created  R-3.3.1
    # we strongly recommend to use a *separate* build directory :
mkdir R-3.3.1-build
cd   R-3.3.1-build
	# and optionally, recommended but not for a hadoop run !!
make check-all	


Note that you do *NEVER* type  'make install'  in the above setup

The only important remaining step is
make a symbolic link of    R-3.3.1-build/bin/R
to a directory part of your PATH.  If you are on a standard
unix/linux/(Mac?) setup :

  mkdir -p ~/bin
  cd ~/bin
  ln -s ~/R-inst/R-3.3.1-build/bin/R .

Alternatively, you could do

  export PATH=$HOME/R-inst/R-3.3.1-build/bin/R:$PATH

but I never do that.
Indeed, I use many R versions in this way, and in the above case
would use

  ln -s  ........../R-3.3.1-build/bin/R   R-3.3.1

and then have R-3.0.0, R-3.0.1, ..., R-3.2.5  R-3.3.0  R-3.3.1 
all in my PATH and all via symbolic links

(and ESS = Emacs Speaks Statistics finds all these
 automagically, so I can each start easily from within Emacs).

Martin Maechler
ETH Zurich

    >  The reason I need to do this is to
    > send R along to a Hadoop cluster so that I can use sparkR
    > with the R version I shipped. The Hadoop cluster doesn't
    > have R installed and the admin won't install it.   I tried
    > a few things but the things I had tried didn't work. Are
    > there any options to configure or PATHs I could use to do
    > this?  Any help is appreciated.  Thanks,Tom [[alternative
    > HTML version deleted]]

    > ______________________________________________
    > R-help at r-project.org mailing list -- To UNSUBSCRIBE and
    > more, see https://stat.ethz.ch/mailman/listinfo/r-help
    > PLEASE do read the posting guide
    > http://www.R-project.org/posting-guide.html
    > and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list