loadRDS: loads an RDS object, assigns it to an object of the...

Description Usage Arguments Examples

View source: R/shorthands.R

Description

saveRDS() saves an object to a file, so unlike save() and load() you can assign the loaded object to a new variable using readRDS(). However, sometimes it may be more convenient to assign the object in the RDS file to an object of the same name as the file. This is what loadRDS() does. It extracts the filename using basename() and tools::file_path_sans_ext()

Usage

1
loadRDS(file, refhook = NULL, overwrite = FALSE)

Arguments

file

path to file

refhook

passed to readRDS

overwrite

whether to overwrite an existing object of the same name. defaults to false.

Examples

1
2
3
4
## Not run: 
loadRDS(file = '~/Models/Spouses.rds') # assigns object contained in file to variable 'Spouses'

## End(Not run)

grebbel/formr_test documentation built on May 17, 2019, 8:34 a.m.