nameRDS: RDS shortcuts

Description Usage Arguments Value Notes Examples

Description

These functions allow the user to type less when using readRDS and saveRDS. The object name followed by RDS is appended to the file destination.

Usage

1
2
3
savenameRDS(x, dir)

readnameRDS(x, dir, envir = NULL)

Arguments

x

R object to serialize.

dir

The file storage location.

envir

The environment to which readnamesRDS assign the R object. The default is NULL in which case it reads in the R object without assigning it.

Value

all functions return either TRUE or FALSE.

Notes

These functions are for convenience only. Does not work with matrix() since length(matrix) does not equal 0.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
x1 <- c(1, 2, 3)
x2 <- data.frame(v1 = 1:10)
savenameRDS(x = x1, dir = getwd())
readnameRDS(x = x1, dir = getwd())
rm(x1)
readnameRDS(x = "x1", dir = getwd(), env = .GlobalEnv)

## End(Not run)

JamesDalrymple/wccmh documentation built on May 7, 2019, 10:20 a.m.