utils (version 3.4.1)

choose.dir: Choose a Folder Interactively

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

Examples

Run this code
  if (interactive())
        choose.dir(getwd(), "Choose a suitable folder")

Run the code above in your browser using DataCamp Workspace