loads an RDS object, assigns it to an object of the base-filename
loadRDS.Rd
saveRDS()
saves an object to a file, so unlike save()
and load()
you can assign the loaded object to a new variable using readRDS()
.
However, sometimes it may be more convenient to assign the object in the RDS file to an object of the same name as the file. This is what loadRDS()
does. It extracts the filename using basename()
and tools::file_path_sans_ext()