[R] Get "home" directory and simple I/O

Alberto Monteiro albmont at centroin.com.br
Fri Mar 23 16:06:04 CET 2007


Prof Brian Ripley wrote:
>
> But the request was for a *generic* solution.  On Windows there
> might not be anything corresponding to a home directory
> (and the rw-FAQ discusses the concept and how R resolves this).
> 
> The best answer I know of is path.expand("~").
> 
Thanks, this is the only solution that works for Windows XP,
and it will probably work for Linux.

Also, in Windows, there are variables homedrive and homepath,
that I could combine to form the path (probably this is what
path.expand does :-))

Sys.getenv("homepath")
Sys.getenv("homedrive")

Alberto Monteiro



More information about the R-help mailing list