Learn R Programming

svDialogs (version 0.9-52)

dlgOpen: A select file(s) to open dialog box

Description

Allows to easily select one or more existings files.

Usage

dlgOpen(default, title, multiple = FALSE, filters = dlgFilters["All", ],
    ..., gui = .GUI)
dlgFilters

## These should not be called directly
## S3 method for class 'gui':
dlgOpen(default, title, multiple = FALSE, filters = dlgFilters["All", ],
    \dots, gui = .GUI)
## S3 method for class 'textCLI':
dlgOpen(default, title, multiple = FALSE, filters = dlgFilters["All", ],
    \dots, gui = .GUI)
## S3 method for class 'nativeGUI':
dlgOpen(default, title, multiple = FALSE, filters = dlgFilters["All", ],
    \dots, gui = .GUI)

Arguments

default
the default file to start with (use /dir/* or /dir/*.* to start in a given directory).
title
a title to display on top of the dialog box.
multiple
is a multiple selection of files allowed?
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 dlgFilters for examples. This is currently ignored on Mac OS X, since suc
...
pass further arguments to methods.
gui
the 'gui' object concerned by this dialog box.

Value

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

concept

GUI API dialog boxes

See Also

dlgSave, dlgDir

Examples

Run this code
## Choose one R file
dlgOpen(title = "Select one R file", filters = dlgFilters[c("R", "All"), ])$res
## Choose several files
dlgOpen(multiple = TRUE)$res

Run the code above in your browser using DataLab