saveRDSreadRDS
saveRDS and readRDS are base R functions designed to serialize a single R object to disk and to restore it later. They provide a compact, language-native mechanism for persisting objects, sharing them between sessions, or caching results. Unlike the save function, which writes one or more named objects to an .RData file, saveRDS and readRDS focus on a single object and do not save the object’s original name.
saveRDS writes a single R object to a file in the RDS format. Its typical usage is
readRDS reads an RDS file and returns the stored object. The returned value is typically assigned to
Compared with save and load, saveRDS/readRDS are ideal for persisting single objects and controlling their loaded