Learn R Programming

utils (version 3.6.0)

choose.dir: Choose a Folder Interactively on MS Windows

Description

Use a Windows shell folder widget to choose a folder interactively.

Usage

choose.dir(default = "", caption = "Select folder")

Arguments

default

which folder to show initially.

caption

the caption on the selection dialog.

Value

A length-one character vector, character NA if ‘Cancel’ was selected.

Details

This brings up the Windows shell folder selection widget. With the default default = "", ‘My Computer’ (or similar) is initially selected.

To workaround a bug, on Vista and later only folders under ‘Computer’ are accessible via the widget.

See Also

choose.files (on Windows) and file.choose (on all platforms).

Examples

Run this code
# NOT RUN {
  if (interactive() && .Platform$OS.type == "windows")
        choose.dir(getwd(), "Choose a suitable folder")
# }

Run the code above in your browser using DataLab