powered by
Consistent wrapper around saveRDS() and readRDS(). write_rds() does not compress by default as space is generally cheaper than time.
saveRDS()
readRDS()
write_rds()
read_rds(path)write_rds(x, path, compress = c("none", "gz", "bz2", "xz"), ...)
write_rds(x, path, compress = c("none", "gz", "bz2", "xz"), ...)
Path to read from/write to.
R object to write to serialise.
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 compression. See connections() for more details.
compression
connections()
write_rds() returns x, invisibly.
x
# NOT RUN { temp <- tempfile() write_rds(mtcars, temp) read_rds(temp) # } # NOT RUN { write_rds(mtcars, "compressed_mtc.rds", "xz", compression = 9L) # }
Run the code above in your browser using DataLab