I'm writing an interactive function that requires that the user to first
select the directory for an input file and then select the input file.  This
is done in two steps so that later in the function, I can call this
directory to write output files.  I'm doing this using choose.dir() and
choose.files().  However, R somehow doesn't update the new directory the
first time choose.files is called but does the second time.  This has been
tested on two machines, both running XP with versions 2.9.2 and 2.11.

Reproducible example using only choose.files():

setwd("C:/");
getwd()
#[1] "C:/"
setwd("C:/Program Files");
getwd()
#[1] "C:/Program Files"
choose.files()
# defaults to C:/
choose.files()
# now defaults to C:/Program Files

We've tried various work-arounds but in the end, we need to call
choose.files twice to get the updated directory.

Ideas?
thanks,
Burton
burtonshank@gmail.com

	[[alternative HTML version deleted]]

