[R] how to define .Renviron to work with different R-versions

From: Poornima Reddy <isha.poornima_at_gmail.com>
Date: Wed, 07 May 2008 11:51:13 -0500


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.



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. Received on Wed 07 May 2008 - 18:10:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 07 May 2008 - 18:30:37 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive