epi_utils_session: Save an R session

Description Usage Arguments Value Author(s) See Also Examples

View source: R/epi_utils_session.R

Description

epi_utils_session() is a convenience function to save an R session.

Usage

1
epi_utils_session(output_prefix = NULL, objects_to_save = NULL, ...)

Arguments

output_prefix

File name as string, '.RData' is appended to saved objects. Default is e.g. 'session_date.RData' eg 'session_2019-03-01.RData'

objects_to_save

String with list of objects to save. Assumes you only want a subset from the R session. Use saveRDS() for one object or save.image() for the whole session instead.

...

pass any other parameters from save() such as compress = 'gzip'

Value

Saves an external representation of the R objects to file

Author(s)

Antonio J Berlanga-Taylor <https://github.com/AntonioJBT/episcout>

See Also

save.image, saveRDS, load, readRDS, epi_utils_log.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 

x <- stats::runif(20)
y <- list(a = 1, b = TRUE, c = "oops")
# See objects to save:
ls()
objects_to_save <- c('x', 'y')
epi_utils_session(output_prefix = 'xy',
                  objects_to_save = objects_to_save
                 )
dir()
rm(list = objects_to_save)
ls()
load('xy.RData')
ls()

## End(Not run)

AntonioJBT/episcout documentation built on Nov. 7, 2019, 5:34 p.m.