Poornima Reddy
2008-May-07 16:51 UTC
[R] how to define .Renviron to work with different R-versions
Hi, I have a simple R script for printing arguments cat > printargs.R << EOF args = commandArgs() print(args) q() EOF To run this script, first I set PATH to ~/src/R-2.6.2 and execute > R --no-save < printargs.R I want to run this script with different R versions by defining an .Renviron file in the same directory as printargs.R cat > .Renviron << EOF R_VERISON=R-2.7.0 R_HOME=~/src/${R_VERSION} PATH=${R_HOME}/bin:${PATH} R_LIBS=${R_HOME}/library EOF Now when I run > R --no-save < printargs.R, I get Error in gzfile(file, "rb") : cannot open the connection In addition: Warning message: In gzfile(file, "rb") : cannot open compressed file '/home/ppreddy/src//library/base/R/base.rdx', probable reason 'No such file or directory' Execution halted I do not know for sure, if I can define R_VERSION, R_HOME, and PATH in .Renviron. All I have seen is defining R_LIBS/JAV_HOME in r-help archives. So, please explain how to use the .Renviron to work with R-different R-versions and also Should I place .Renviron in the home dir instead of cwd? Thanks, Poornima.
Maybe Matching Threads
- Question on trying to build R 2.11.1 on Tru64(aka OSF1)
- Renviron settings for Linux Distributions: please tell me R Core's advice
- .Renviron and Renviron.site (on Windows XP)
- Customization options with .Renviron, R_LIBS, .Rprofile etc
- R CMD check not reading R_LIBS from ~/.R/check.Renviron