The choose.dir function reference page there is an example:
choose.dir(getwd(), "Choose a suitable folder")
Which should start the folder choice window at the working directory. However I am only having the folder choice window open at 'My Computer'. What reasons could there be for this function not working as intended?
You are right in that you should not use
choose.dir()
, as it is OS-specific. I can indeed reproduce the issue you report - my guess is that it won't let you start in a directory that belongs to the "Root" user (whatever that may mean in Windows), because it seems to work well for other directories, not under 'Root':There are two OS-independent solutions; the first, as it has been pointed out before, is to use the following functionality from the
tcltk
package:The second is to use the
rChoiceDialogs
package (requiresrJava
):