[R] How do I tell it which directory to use?

Simon Blomberg blomsp at ozemail.com.au
Wed Feb 22 06:52:22 CET 2006


I think you want getwd() and setwd().

HTH,

Simon.

Thomas L Jones wrote:
> >From Tom:
>
> In R 2.2.0 under Windows, I want to be able to give it a filename such 
> as "myFile.txt" without the quotes. But actually I mean:
>
> C:\Documents and Settings\Tom\My Documents\qpaper7\R Project Started 
> 19 Dec 05\myFile.txt
>
> If I were to repeat this each time, my computer would get all bored 
> and cranky and start to drop bits (only a joke, of course). I think I 
> want to set the Home directory or the working directory or some 
> directory or other to the above directory. I may or may not want to 
> set some environmental variables.
>
> R 2.2.0; working directly from the console and copying and pasting 
> code which I want to test into the console. Windows XP Home Edition. 
> Administrator privileges are enabled. A curve ball: There are two 
> accounts, "Tom" and "Jones;" the data are stored under "Tom," whereas 
> the computation is being done under the "Jones" account. I won't bore 
> you with the details of why I am doing this.
>
> I was able to call Sys.getenv ("R_USER") and get the home directory.
>
> I am a newbie to R and not familiar with the terminology.
>
> Tom
> Thomas L. Jones, Ph.D., Computer Science
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>   


-- 
Simon Blomberg, B.Sc.(Hons.), Ph.D, M.App.Stat.
Centre for Resource and Environmental Studies
The Australian National University
Canberra ACT 0200
Australia
T: +61 2 6125 7800 email: Simon.Blomberg_at_anu.edu.au
F: +61 2 6125 0757
CRICOS Provider # 00120C




More information about the R-help mailing list