rdata
How can I load an object into a variable name that I specify from an R data file?
If you’re just saving a single object, don’t use an .Rdata file, use an .RDS file: x <- 5 saveRDS(x, “x.rds”) y <- readRDS(“x.rds”) all.equal(x, y)
Get specific object from Rdata file
.RData files don’t have an index (the contents are serialized as one big pairlist). You could hack a way to go through the pairlist and assign only entries you like, but it’s not easy since you can’t do it at the R level. However, you can simply convert the .RData file into a lazy-load database … Read more
What are the main differences between R data files?
Rda is just a short name for RData. You can just save(), load(), attach(), etc. just like you do with RData. Rds stores a single R object. Yet, beyond that simple explanation, there are several differences from a “standard” storage. Probably this R-manual Link to readRDS() function clarifies such distinctions sufficiently. So, answering your questions: … Read more