[R] set working directory

Spencer Graves spencer.graves at pdf.com
Fri Jun 18 18:43:48 CEST 2004


         I agree with Uwe:  I just tried "setwd" missing a quote in R 
1.9.1 alpha and got "syntax error".  When I had quotes paired but the 
name was not a valid directory, I got the error Louize reported:  "Error 
in setwd(dir) : cannot change working directory".  When I gave a valid 
directory, the command worked. 

      To make sure I don't make spelling errors in a directory under 
Windows 2000, I copy the address from the Windows Explorer into 
something like MS Word first, replace "\" with "/" and then copy the 
result into R. 

      hope this helps.  spencer graves

Uwe Ligges wrote:

> Bashir Saghir (Aztek Global) wrote:
>
>> Try adding a missing singe quote (') at the end of your working 
>> directory.
>>
>> setwd('d:/folder_name')  
>
>
> Well, that was a mispelling in the mail, but not in the real example, 
> since not specifying the quote causes a syntax error.
>
> I'm quite sure the folder-name was misspelled in the real example.....
>
> Uwe Ligges
>
>
>> S.
>>
>>
>> -----Original Message-----
>> From: r-help-bounces at stat.math.ethz.ch
>> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Louize Hill
>> Sent: Friday, June 18, 2004 13:38
>> To: r-help at stat.math.ethz.ch
>> Subject: [R] set working directory
>>
>>
>> I have just upgraded from rw1081 to rw1090 (using Windows 2000).
>>
>> Now when I type the command:
>>
>>
>>> setwd('d:/folder_name)
>>
>>
>>
>> I get the following error message:
>>
>> Error in setwd(dir) : cannot change working directory
>>
>> If I use the "change dir" tab in the file menu i can sucessfully change
>> working directories, but this is not so convenient as i have my whole 
>> model
>> stored as a text file that I prefer to copy into R.
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide!
>> http://www.R-project.org/posting-guide.html
>>
>>
>> --------------------------------------------------------- Legal 
>> Notice: This electronic mail and its attachments are i...{{dropped}}
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! 
>> http://www.R-project.org/posting-guide.html
>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list