Retrieving .rda into a different variable name in R

1. Using environment

x <- 1
save(x, file = 'saved_x.rda')
Data.Env <- new.env()
load(file = 'saved_x.rda')
y <- Data.Env$x

2. Using saveRDS, readRDS for a single object

x <- 1
saveRDS(x, file = 'saved_x.rds')
y <- readRDS('saved_x.rds')
Retrieving rda into a different variable name in…
Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *