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, <mdusa...@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@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. > ______________________________________________ R-help@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.