Learn R Programming

RSurvey (version 0.9.3)

GetFile: GUI: Select File to Open or Save As

Description

A graphical user interface (GUI) for selecting files to open or save.

Usage

GetFile(cmd = c("Open", "Save As"), file = NULL, exts = NULL,
  initialdir = NULL, initialfile = NULL, defaultextension = NULL,
  win.title = cmd, multi = FALSE, parent = NULL)

Arguments

cmd

character. Specifies whether an "Open" or "Save As" file management pop up dialog box is implemented.

file

character. File name that the data are to be read from. Alternatively, file can be a readable text-mode connection.

exts

character. Vector of default file extensions.

initialdir

character. Files in this directory will be displayed in the dialog box.

initialfile

character. File name to display in the dialog box.

defaultextension

character. String appended to the file name if the user enters a file name without an extension.

win.title

character. String to display as the title of the dialog box.

multi

logical. If true, multiple files may be selected.

parent

tkwin. GUI parent window

Value

If multi is false, returns the file path as a character object with the following attributes:

directory

directory containing the file

name

file name

extension

file extension

type

file type

Otherwise, a list is returned containing a object of class character for each file.

Examples

Run this code
# NOT RUN {
  GetFile()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab