Load R data files from a directory using symbols rather than complete file
RDATA file extensions.
1 2 3 4 5 6 7
Object names. Note that these arguments are interpreted as symbols using non-standard evaluation for convenience during interactive use, and must not be quoted.
loadData() is opinionated about the format of R data files it will accept.
save() allows for the saving of multiple objects into a single R data file.
This can later result in unexpected accidental replacement of an existing
object in the current environment. Since an R data file internally stores the
name of an object, if the file is later renamed the object name will no
To avoid any accidental replacements,
loadData() will only load R data
files that contain a single object, and the internal object name must match
the file name exactly. Additionally,
loadData() will intentionally error if
an object with the same name already exists in the destination
This function is desired for interactive use and interprets object names using non-standard evaluation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
dir <- system.file("extdata", package = "pipette") ## Interactive mode ==== ## Note that this method uses non-standard evaluation. loadData(example, dir = dir) ## Clean up. rm(example, inherits = TRUE) ## List mode ==== ## Note that this method uses standard evaluation. ## Use this approach inside of functions. list <- "example" loadData(list = list, dir = dir) ## Clean up. rm(example, inherits = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.