Wrapper for save() supporting quick, interactive saving of object names passed as symbols.

saveData(..., dir = getOption("acid.save.dir", default = "."),
  ext = getOption("acid.save.ext", default = c("rds", "rda")),
  overwrite = getOption("acid.save.overwrite", default = TRUE),
  compress = getOption("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.


character(1). Directory path.


character(1). R data serialized (RDS) or R data (RDA, RDATA). RDS is preferred when saving single objects per file, which is always the convention of saveData(), regardless of the extension used.


logical(1). Overwrite existing file on disk.


logical or character string specifying whether saving to a named file is to use compression. TRUE corresponds to gzip compression, and character strings "gzip", "bzip2" or "xz" specify the type of compression. Ignored when file is a connection and for workspace format version 1.


character. A character vector containing the names of objects to be saved. Note that this approach differs from save() in that the objects are saved individually to disk, instead of inside a single R data file. Requires objects to be defined in globalenv().


environment. Environment.


Invisible named character. File paths.


This function always saves each object into a separate file rather than combining multiple objects into a single file.


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().

See also


dir <- "example" ## Interactive mode ==== ## Note that this method uses non-standard evaluation. a <- 1 b <- 2 saveData(a, b, dir = dir)
#> Saving a.rds, b.rds to /home/mike/acidbase/packages/brio/docs/reference/example
#> [1] "a.rds" "b.rds"
## Clean up. unlink(dir, recursive = TRUE) ## 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)
#> Saving a.rds, b.rds to /home/mike/acidbase/packages/brio/docs/reference/example
#> [1] "a.rds" "b.rds"
## Clean up. unlink(dir, recursive = TRUE)