Learn R Programming

RSurvey (version 0.5.0)

getFile: Select a File to Open or Save As

Description

A GUI for selecting a file to open or save.

Usage

getFile(parent, cmd = "Open", file = NULL, exts = NULL, 
initialdir = NULL, initialfile = NULL, defaultextension = NULL, 
caption = cmd, multi = FALSE)

Arguments

parent
tkwin; the parent window (optional)
cmd
character; specifies if an "Open" or "Save As" file management pop up dialog box is implemented.
file
character; the name of the file which the data are to be read from. Alternatively, file can be a readable text-mode connection (optional).
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 filename to be displayed in the dialog when it pops up.
defaultextension
character; the string that will be appended to the filename if the user enters a filename without an extension.
caption
character; a string to display as the title of the dialog box.
multi
logical; if TRUE multiple files may be selected

Value

  • If multi is FALSE returns a list containing the following components:
  • pathcharacter; the file path
  • dircharacter; the directory that contains the file
  • namecharacter; the file name
  • extcharacter; the file extension
  • typecharacter; the file type
  • Otherwise, a list is returned containing list components for each file.

Examples

Run this code
getFile()

Run the code above in your browser using DataLab