[R] Transferring R to another computer, R_HOME_DIR

p_connolly at slingshot.co.nz p_connolly at slingshot.co.nz
Fri Apr 26 03:26:37 CEST 2013


Quoting Saptarshi Guha <saptarshi.guha at gmail.com>:

> Hello,
>
> I was looking at the R (installed on RHEL6) shell script and saw
> R_HOME_DIR=/usr/lib64/R. Nowhere (and I could have got it wrong) does
> it read in the environment value R_HOME_DIR. I have the need to rsync
> the entire folder below /usr/lib64/R to another computer into another
> directory location. Without changing the R shell script, how can i
> force it read in R_HOME_DIR?
>
> Or maybe i misunderstood the bash source?
>
> (Note, i cannot recompile on target machine)

If you can't compile on the target machine, that indicates that you wouldn't
have access to /usr/lib64/R anyway, so you need a different approach.

Fortunately, it's easy to compile into your home directory where you do have
write access.  The INSTALL file in the distributed tar.gz file shows 
you how to
compile where you want and what link you need to make it accessible.  Even
though the file is called INSTALL, it explains how it's not necessary to
install R in order to use it.

HTH






>
> Cheers
> Saptarshi
>
> 1. I also realize Rscript will not work (i think path is hard coded in the
> source)
>
> Beginning of /usr/lib64/R/bin/R
>
> R_HOME_DIR=/usr/lib64/R
> if test "${R_HOME_DIR}" = "/usr/lib64/R"; then
>    case "linux-gnu" in
>    linux*)
>      run_arch=`uname -m`
>      case "$run_arch" in
>         x86_64|mips64|ppc64|powerpc64|sparc64|s390x)
>           libnn=lib64
>           libnn_fallback=lib
>         ;;
>         *)
>           libnn=lib
>           libnn_fallback=lib64
>         ;;
>      esac
>      if [ -x "/usr/${libnn}/R/bin/exec/R" ]; then
>         R_HOME_DIR=/usr/lib64/R
>      elif [ -x "/usr/${libnn_fallback}/R/bin/exec/R" ]; then
>         R_HOME_DIR=/usr/lib64/R
>      ## else -- leave alone (might be a sub-arch)
>      fi
>      ;;
>   esac
> fi
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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