Re: [R] (no subject)

From: Adaikalavan Ramasamy <ramasamy_at_cancer.org.uk>
Date: Tue 01 Mar 2005 - 15:33:54 EST

Reading the posting guide http://www.R-project.org/posting-guide.html will tell you to specify an informative subject line in your postings.

You can change working directory by using setwd(), see help("setwd"). For example setwd("c:\My Documents") might work. I am not sure if you need to truncate the path names to 8 characters anymore.

But if you want to read files in other directory, you can do so without changing your current working directory. As long as you can supply the absolute or full path, you should be fine.

For example read.delim(file="c:\My Documents\project1\datafile.txt") would read that file into R regardless of current directory.

If you use absolute paths and if you saved the commands onto a script file, then you can re-execute these command under whatever version of R. I would recommend this approach since you will have a rather static working directory.

Regards, Adai

On Tue, 2005-03-01 at 12:33 +1300, Brett Stansfield wrote:
> Dear R
> Can you tell me how to change the working directory of R
>
> It's just that I have some text files that I wish to save separately from
> the R filing structure eg. into C:/my documents and need to change the
> working directory of R so that it reads these files . This means if I ever
> upgrade the current version of R nothing will be effected.
>
> brett
>
> Brett Stansfield
> Environmental Scientist - Water Quality
> Hawke's Bay Regional Council
> 102 Vautier Street
> Private Bag 6006
> Napier
> Phone (06) 835-9200 extn 9334
> Fax (06) 835-3601
>
> ______________________________________________
> R-help@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
>



R-help@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 Received on Tue Mar 01 16:23:03 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:38 EST