Learn R Programming

svDialogs (version 0.9-50)

dlgDir: A select directory dialog box

Description

Allows to easily select a directory.

Usage

dlgDir(default = getwd(), title, ..., gui = .GUI)

## These should not be called directly
## S3 method for class 'gui':
dlgDir(default = getwd(), title, ..., gui = .GUI)
## S3 method for class 'textCLI':
dlgDir(default = getwd(), title, ..., gui = .GUI)
## S3 method for class 'nativeGUI':
dlgDir(default = getwd(), title, ..., gui = .GUI)

Arguments

default
the directory to start with.
title
a title to display on top of the dialog box.
...
pass further arguments to methods.
gui
the 'gui' object concerned by this dialog box.

Value

  • The modified 'gui' object is returned invisibly. The choosen directory, or an empty string if the cancel button was clicked is found in gui$res (see example).

concept

GUI API dialog boxes

See Also

dlgOpen, dlgSave

Examples

Run this code
### A quick default directory changer
setwd(dlgDir(default = getwd())$res)

Run the code above in your browser using DataLab