[R] Fw: Setting working directory interactively within a function

From: Michel Friesenhahn <michel.friesenhahn.b_at_bayer.com>
Date: Sat 15 Oct 2005 - 05:31:05 EST


>On 10/14/2005 1:08 PM, Berton Gunter wrote:
>> ?setwd
>> e.g. setwd(file.choose())
>>
>> BTW, you could have found this on your own via help.search('working
>> directory') . Base R has quite good docs -- you should try them first.
>>
>> -- Bert Gunter
>
>That won't work in Windows, where the dialogs don't consider directories
>to be files so won't return them.
>
>As far as I know no platform lets you setwd() to a file (even though
>this might make sense: setwd("foo") could mean change to foo if it's a
>directory, to the directory it's in if it's a file).
>
>Duncan Murdoch

It might be better to allow file.choose() to select and return directories. Allowing setwd("foo") to work if "foo" is a file won't help if you're starting a new project in an empty directory.

Mike
----- Forwarded by Michel Friesenhahn/EMVL/DIAG/US/BAYER on 10/14/2005 12:27 PM -----

Duncan Murdoch <murdoch@stats.uwo.ca>
Sent by: r-help-bounces@stat.math.ethz.ch 10/14/2005 10:24 AM

To
Berton Gunter <gunter.berton@gene.com>
cc
"'Paul Baer'" <pbaer@berkeley.edu>, r-help@stat.math.ethz.ch Subject
Re: [R] Setting working directory interactively within a function



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

        [[alternative HTML version deleted]]



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 Sat Oct 15 05:39:00 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:54:37 EST