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

Alberto Monteiro albmont at centroin.com.br
Fri Mar 23 13:30:17 CET 2007


Is there any generic function that gets the "home" directory? This
should return /home/<user> in Linux and 
x:/Documents and Settings/<user> (or whatever) in Windows XP.

Another (unrelated) question: what is the _simplest_ way to
read and write R variables to/from files such that they are
stored in a human-readable but R-like form? For example, if 
(say), x is a vector defined as x <- c(1, 2, 3), can I write 
(and read) x as a file with just one line, namely: c(1, 2, 3) ?

Alberto Monteiro



More information about the R-help mailing list