Save Compressed *.rds
File
save_rds.Rd
A thin wrapper around saveRDS()
that ensures two things:
The path extension is consistent and lowercase
*.rds
The compression used is
"xz"
, which is often optimal for proteomic data
Arguments
- object
R object to serialize.
- file
a connection or the name of the file where the R object is saved to or read from.
- ...
the names of the objects to be saved (as symbols or character strings).
Functions
save_rda()
: similar tosave_rds()
, but for saving serialized*.rda
compressed files.get_compression()
: determine the type of compression for a serialized binary file.
Examples
if (FALSE) { # \dontrun{
# all are the same
save_rds(x, "outfile.rds")
save_rds(x, "outfile.RDS")
save_rds(x, "outfile.Rds")
# similar functionality for rda
# as with `save()`, must specify file argument explicitly
save_rda(x, file = "outfile.rda")
# determine the compression ('xz')
get_compression("outfile.rda")
} # }