read_rds {readr} | R Documentation |
Consistent wrapper around saveRDS()
and readRDS()
.
write_rds()
does not compress by default as space is generally cheaper
than time.
read_rds(path) write_rds(x, path, compress = c("none", "gz", "bz2", "xz"), ...)
path |
Path to read from/write to. |
x |
R object to write to serialise. |
compress |
Compression method to use: "none", "gz" ,"bz", or "xz". |
... |
Additional arguments to connection function. For example, control
the space-time trade-off of different compression methods with
|
write_rds()
returns x
, invisibly.
temp <- tempfile() write_rds(mtcars, temp) read_rds(temp) ## Not run: write_rds(mtcars, "compressed_mtc.rds", "xz", compression = 9L) ## End(Not run)