Learn R Programming

svDialogs (version 1.0.0)

dlg_save: 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, title, filters = dlg_filters["All", ], ..., gui = .GUI)

dlgSave(default, title, filters = dlg_filters["All", ], ..., gui = .GUI)

# S3 method for gui dlgSave(default, title, filters = dlg_filters["All", ], ..., gui = .GUI)

# S3 method for textCLI dlgSave(default, title, filters = dlg_filters["All", ], ..., gui = .GUI)

# S3 method for nativeGUI dlgSave(default, title, filters = dlg_filters["All", ], ..., gui = .GUI)

Arguments

default

The default file to start with (use /dir/* or /dir/*.* to start in a given directory, but without predefined name).

title

A title to display on top of the dialog box.

filters

A specification of file filters as a nx2 matrix, or a character string with even number of items. First items is the label, second one is the filter. See dlg_filters for examples. This is currently ignored on MacOS, since such kind of filter is defined differently there.

...

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 gui$res (see example). For existing files, confirmation is always asked!

See Also

dlg_open(), dlg_dir()

Examples

Run this code
# 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
# }

Run the code above in your browser using DataLab