| dlg_save {svDialogs} | R Documentation |
Modal dialog to select a file to save to.
Description
Select an existing file, or create a new one to save data.
Usage
dlg_save(
default = "untitled",
title = "Save file as",
filters = dlg_filters["All", ],
...,
gui = .GUI
)
dlgSave(
default = "untitled",
title = "Save file as",
filters = dlg_filters["All", ],
...,
gui = .GUI
)
## S3 method for class 'gui'
dlg_save(default, title, filters = dlg_filters["All", ], ..., gui = .GUI)
## S3 method for class 'textCLI'
dlg_save(default, title, filters = dlg_filters["All", ], ..., gui = .GUI)
## S3 method for class 'nativeGUI'
dlg_save(
default,
title,
filters = dlg_filters["All", ],
rstudio = getOption("svDialogs.rstudio", TRUE),
...,
gui = .GUI
)
Arguments
default |
The default file to start with (use |
title |
A title to display on top of the dialog box. |
filters |
A specification of file filters as a |
... |
Pass further arguments to methods. |
gui |
The modified 'gui' object is returned invisibly. The chosen file,
or an empty string (if the "cancel" button was clicked or confirmation was
cancelled) is placed in |
rstudio |
Logical. Should 'RStudio' dialog boxes automatically be used
if available? If |
Note
In case the file already exists, the user is prompted to confirm he
wants to overwrite the existing file. If he clicks 'Cancel', then the
return is an empty string. The 'RStudio' version of this dialog box currently
ignores the filters = argument.
See Also
Examples
## Not run:
# Choose one R filename to save some R script into it
dlg_save(title = "Save R script to", filters = dlg_filters[c("R", "All"), ])$res
## End(Not run)