Learn R Programming

RSurvey (version 0.8-3)

GetFile: Select File to Open or Save As

Description

A GUI for selecting files to open or save.

Usage

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

Arguments

cmd
character; specifies if an "Open" or "Save As" file management pop up dialog box is implemented.
file
character; the file name which the data are to be read from. Alternatively, file can be a readable text-mode connection.
exts
character; a vector of default file extensions.
initialdir
character; specifies that the files in this directory should be displayed when the dialog pops up.
initialfile
character; the file name to be displayed in the dialog when it pops up.
defaultextension
character; the string that will be appended to the file name if the user enters a file name without an extension.
win.title
character; a string to display as the title of the dialog box.
multi
logical; if TRUE multiple files may be selected; its default is FALSE.
parent
tkwin; the GUI parent window.

Value

If multi is FALSE returns the file path as a charcter object with the following attributes:
directory
character; the directory that contains the file
name
character; the file name
extension
character; the file extension
type
character; the file type
Otherwise, a list is returned containing a character object for each file.