load_in_new_env | R Documentation |
Unlike load()
, this function avoids polluting the global
namespace by loading objects into separate environment.
load_in_new_env(file, envir = new.env(), ...)
file |
This argument has the same meaning as in |
envir |
If you pass an existing environment, objects will be loaded into that environment instead of a newly-created one, and this same environment will be returned. |
... |
Further arguments are passed to |
This function is useful for loading data files that potentially contain many objects with common names that might otherwise overwrite existing objects with the same name.
An environment containing all the objects loaded from
file
.
save.image()
x <- 5 y <- 3 datafile <- tempfile(fileext = ".rda") save(file = datafile, list = c("x", "y")) rm(x,y) loaded_vars <- load_in_new_env(datafile) as.list(loaded_vars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.