ReadData: Reads data from an RDS data file via a file open dialog.

Description Usage Details Value See Also Examples

View source: R/firstapiR_util.R

Description

Displays the tcltk package's read file dialog. Once the user enters or selects a file name, ReadData() will read and return the value stored in the corresponding RDS data file. The dialog will initially display the current working directory (see getwd() and setwd()).

Usage

1

Details

ReadData uses the readRDS() function, from R's base package, to read R data. The data is stored in the RDS file as an unnamed object, so the user must assign the return value to a named variable.

Throws an error if the selected file does not end in "RDS" (case-insensitive). Prints a message if the user cancels the dialog without selecting a file.

Value

The R object stored in the RDS data file, or NA if the user cancels the dialog without selecting a file.

See Also

readRDS, getwd, setwd

Examples

1
2
3
4
## Not run: 
my.data <- ReadData()

## End(Not run)

irwinsnet/FIRST_api_R documentation built on May 17, 2017, 4:23 a.m.