saveData | R Documentation |
Wrapper for save()
supporting quick, interactive saving of object names
passed as symbols.
saveData(
...,
dir = getOption(x = "acid.save.dir", default = getwd()),
ext = getOption(x = "acid.save.ext", default = "rds"),
overwrite = getOption(x = "acid.overwrite", default = TRUE),
compress = getOption(x = "acid.save.compress", default = TRUE),
list = NULL,
envir = parent.frame()
)
... |
Object names. Note that these arguments are interpreted as symbols using non-standard evaluation for convenience during interactive use, and must not be quoted. |
dir |
|
ext |
Supported arguments:
RDS is preferred when saving single objects per file, which is always the
convention of |
overwrite |
|
compress |
logical or character string specifying whether saving
to a named file is to use compression. |
list |
|
envir |
|
This function always saves each object into a separate file rather than combining multiple objects into a single file.
Invisible named character
.
File paths.
This function is desired for interactive use and interprets object
names using non-standard evaluation. It will overwrite existing files
on disk, following the same conventions as save()
.
Updated 2023-06-29.
save()
.
saveRDS()
.
dir <- AcidBase::tempdir2()
## Interactive mode ====
## Note that this method uses non-standard evaluation.
a <- 1
b <- 2
saveData(a, b, dir = dir)
sort(list.files(dir))
## Clean up.
AcidBase::unlink2(dir)
## List mode ====
## Note that this method uses standard evaluation.
## Use this approach inside of functions.
a <- 1
b <- 2
list <- c("a", "b")
saveData(list = list, dir = dir)
sort(list.files(dir))
## Clean up.
AcidBase::unlink2(dir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.