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.
______________________________________________
[email protected] 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.