View source: R/nice_utilities.R
nice_load | R Documentation |
load()
loads all objects in the data file which is fine for most of the uses.
However, one may wish to load only a single object, if, for example, one has conflicting object names in the same environment.
This function also allows the user to rename an object within the data frame.
Unfortunately, it is not possible to selectively load objects so this function loads every thing in the data file, and then drops what is not required.
Cribbed from https://stackoverflow.com/questions/8700619/get-specific-object-from-rdata-file
nice_load(file, object, rename = NULL)
file |
An .RData file |
object |
An object known to be saved within the RData file |
rename |
String, a new name for the object to take |
x <- 1 y <- 2 save(x,y, file = paste0(tempdir(), "/temp.RData")) rm(x, y) nice_load(file = paste0(tempdir(), "/temp.RData"), "y") nice_load(file = paste0(tempdir(), "/temp.RData"), "y", rename = "z")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.