SaveData: Saves data to an RDS data file via a file save dialog.

Description Usage Arguments Details Value See Also Examples

View source: R/firstapiR_util.R

Description

Displays the tcltk package's save file dialog. Once the user enters or selects a file name, SaveData() will save the value passed in parameter x to an RDS data file. The dialog will initially display the current working directory (see getwd() and setwd()).

Usage

1

Arguments

x

An R object that will be saved to an RDS file.

Details

SaveData uses the saveRDS() function, from R's base package, to save R data. RDS files can only contain a single object. To save more than one object in single file, just put the objects in a list.

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

NULL (invisibly), or NA if the user cancels the dialog without selecting a file.

See Also

saveRDS, getwd, setwd

Examples

1
2
3
4
5
6
## Not run: 
sn <- GetSession("username", "key", season = 2016)
sched <- GetSchedule(sn, "ORPHI")
SaveData(sched)

## End(Not run)

irwinsnet/firstapiR documentation built on Dec. 22, 2020, 5:13 p.m.