[R] set choose.files directory?

Schalk Heunis schalk.heunis at gmail.com
Thu Sep 24 10:03:27 CEST 2009


See http://finzi.psych.upenn.edu/Rhelp08/2009-March/192978.html

You can do something like:
default.search = paste(getwd(),"/*.txt",sep="")
infile2 = choose.files(default.search,filters =
Filters[c("txt","All"),], caption = "Choose ECD datafile")

Schalk Heunis


On Wed, Sep 23, 2009 at 8:57 PM,  <mdusaire at umn.edu> wrote:
> Hi,
>
> I've been trying to set the directory for choose.files as follows:
>
> [R2.9.0 running on XP]
>
> setwd("C:/Documents and Settings/2/Data")
> getwd()
>
> infile2 = choose.files(filters = Filters[c("txt","All"),], caption = "Choose
> ECD datafile")
> #<...do a bunch of stuff...>
>
> It appears the working directory isn't updated until after choose.files()
> executes. getwd() returns the correct path, as set by setwd(), but the path
> does not appear to be used by choose.files() unless I execute choose.files()
> a second time.
>
> Help.  Thanks.
>
> Martin
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list