Select an existing directory, or create a new one.
dlg_dir(default = getwd(), title = "Choose a directory", ..., gui = .GUI)dlgDir(default = getwd(), title = "Choose a directory", ..., gui = .GUI)
# S3 method for gui
dlg_dir(default = getwd(), title, ..., gui = .GUI)
# S3 method for textCLI
dlg_dir(default = getwd(), title, ..., gui = .GUI)
# S3 method for nativeGUI
dlg_dir(
default = getwd(),
title,
rstudio = getOption("svDialogs.rstudio", TRUE),
...,
gui = .GUI
)
The path to the default directory that is proposed (e.g., current working directory).
A title to display on top of the dialog box.
Pass further arguments to methods.
The 'gui' object concerned by this dialog box.
Logical. Should 'RStudio' dialog boxes automatically be used
if available? If FALSE
, force using OS dialog boxes, but only in
'RStudio Desktop' (ignored in 'RStudio Server'). Can be changed globally
with options(svDialogs.rstudio = TRUE|FALSE)
. TRUE
by default.
The modified 'gui' object is returned invisibly. Use its gui$res
component to get the returned directory (the string is empty when the user
cancelled the dialog box, see example).
# NOT RUN {
# A quick default directory changer
setwd(dlg_dir(default = getwd())$res)
# }
Run the code above in your browser using DataLab