Re: [R] Query concerning working directory for file.choose()

2024-12-19 Thread J C Nash
Thanks Duncan. The behaviour is tricky, and I'm still not sure I can predict it. Indeed, I spent about an hour fiddling with file.choose(). It allows navigation across directories, so is not totally without value. However, I've noticed users are very prone to making errors when they aren't in t

Re: [R] Query concerning working directory for file.choose()

2024-12-19 Thread peter dalgaard
Yes, this is different in RStudio, e.g. I had actually forgotten how brain-dead the CLI version is: > file.choose() Enter file name: (Given that install.packages() fires up a Tcl/Tk chooser, users might reasonably expect us to do something at least slightly smarter). - Peter > On 18 Dec 2024

Re: [R] Query concerning working directory for file.choose()

2024-12-18 Thread Duncan Murdoch
I believe file.choose() remembers the last choice, and repeats that location the next time you call it. This is true when it is called at top level or from within a function. The first time you call it in a session, it will default to the current working directory, but not after that. Front

Re: [R] Query concerning working directory for file.choose()

2024-12-18 Thread Bert Gunter
choose.files is only for MS Windows (the Help file says). -- Bert On Wed, Dec 18, 2024 at 8:06 AM Gabor Grothendieck wrote: > > Try choose.files > > choose.files(default = file.path(mydir, "*.*"), multi = FALSE) > > On Wed, Dec 18, 2024 at 10:33 AM J C Nash wrote: > > > > I've been working

Re: [R] Query concerning working directory for file.choose()

2024-12-18 Thread Gabor Grothendieck
P.S. That assumes Windows. On Wed, Dec 18, 2024 at 11:02 AM Gabor Grothendieck wrote: > > Try choose.files > > choose.files(default = file.path(mydir, "*.*"), multi = FALSE) > > On Wed, Dec 18, 2024 at 10:33 AM J C Nash wrote: > > > > I've been working on a small personal project that needs

Re: [R] Query concerning working directory for file.choose()

2024-12-18 Thread Gabor Grothendieck
Try choose.files choose.files(default = file.path(mydir, "*.*"), multi = FALSE) On Wed, Dec 18, 2024 at 10:33 AM J C Nash wrote: > > I've been working on a small personal project that needs to select files for > manipulation from > various directories and move them around in planned ways. f

[R] Query concerning working directory for file.choose()

2024-12-18 Thread J C Nash
I've been working on a small personal project that needs to select files for manipulation from various directories and move them around in planned ways. file.choose() is a nice way to select files. However, I've noticed that if file.choose() is called within a function, it is the directory from