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
If you want get a username of user currently running R on Linux,you can use a
system command and read enviroment variables:
paste(/home/,system (whoami,intern=TRUE),sep=)
Andris Jankevics
On Piektdiena, 23. Marts 2007 14:30, Alberto Monteiro wrote:
Is there any generic function that gets the
Sys.getenv(HOME) works in Linux at least
- Henrik
Andris Jankevics wrote:
If you want get a username of user currently running R on Linux,you can use a
system command and read enviroment variables:
paste(/home/,system (whoami,intern=TRUE),sep=)
Andris Jankevics
On Piektdiena, 23. Marts
On 3/23/07, Alberto Monteiro [EMAIL PROTECTED] wrote:
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
See:
?R.home
?dput
On 3/23/07, Alberto Monteiro [EMAIL PROTECTED] wrote:
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_
From: Gabor Grothendieck
See:
?R.home
That's not what Alberto wanted: It gives the location of the R
installation, not where user's home directory is. AFAIK Windows does
not set the HOME environment variable by default.
?dput
On 3/23/07, Alberto Monteiro [EMAIL PROTECTED] wrote:
Is
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(~).
On Fri, 23 Mar 2007, Henrik Andersson wrote:
Sys.getenv(HOME)
On 3/23/07, Liaw, Andy [EMAIL PROTECTED] wrote:
From: Gabor Grothendieck
See:
?R.home
That's not what Alberto wanted: It gives the location of the R
installation, not where user's home directory is. AFAIK Windows does
not set the HOME environment variable by default.
ok. Try this,
path.expand(~) also seems to work on Windows XP.
On 3/23/07, Prof Brian Ripley [EMAIL PROTECTED] 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
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
Andris Jankevics wrote:
If you want get a username of user currently running R on Linux,you can use a
system command and read enviroment variables:
paste(/home/,system (whoami,intern=TRUE),sep=)
This would be more to the point (and safer), I think.
Sys.getenv(HOME)
HOME
/home/bs/pd
11 matches
Mail list logo