[R] unix environment variables under R

Peter Wolf pwolf at wiwi.uni-bielefeld.de
Tue Oct 29 15:17:05 CET 2002

Jan Malte Wiener wrote:

>i am working on a little R-project with a couple od other guys.we use
>CVS, but everyone keeps the R-source files in different locations in
>home-directory. of course this causes trouble when sourcing R-files. i
>thought a UNIX environment variable could be the solution, but R
>seem to know about the environment variables.
>e.g. >> source("$PROJECT/xxx.R") results in
> >> Error in file(file, "r") : unable to open connection
>is there something like environment variables for R?

What about:

> paste(system("echo $HOME",T),"sourcefile.r",sep="/")


> source(paste(system("echo $HOME",T),"sourcefile.r",sep="/"))

Peter Wolf

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list