Description Usage Arguments Value Author(s) Examples
Restores the class definitions from an R binary file to the specified environment.
1 | restoreClassDefinitions(file = "session.RData", envir = .GlobalEnv, clean = TRUE, srcEnv)
|
file |
path to an R binary file |
envir |
the environment into which the class definitions should be restored. |
clean |
boolean indicating whether the environment should be purged of existing class definitions prior to restoring |
srcEnv |
environment from which to restore class definitions. if this argument is provided the "file" arguments is ignored. |
This method is executed for it's side-effects.
Matthew D. Furia matt.furia@sagebase.org
https://github.com/MattNapsAlot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## make some objects
aMatrix <- diag(10)
letters <- c("a", "b", "c")
## save the session
sessionFile <- tempfile(fileext=".rbin")
saveSession(list = ls(), file = sessionFile)
## create an environment where they can be restored
env <- new.env()
## define an S4 class
setClass("foo", where = env)
## restore the objects leaving "goo"
restoreClassDefinitions(file = sessionFile, envir = env, clean = FALSE)
ls(env)
## restore the objects again, this time delete all objects from env first
restoreClassDefinitions(file = sessionFile, envir = env, clean = TRUE)
ls(env)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.