Wrapper functions to load(), save(), and unlink(), permitting lists of objects to be loaded/saved/deleted all at once.

loadObjects(
  objects,
  path = NULL,
  ext = ".RData",
  quiet = TRUE,
  envir = parent.frame()
)

saveObjects(
  objects,
  path = NULL,
  ext = ".RData",
  quiet = TRUE,
  envir = parent.frame()
)

rmObjects(objects, path = NULL, ext = ".RData", quiet = TRUE)

Arguments

objects

A character list or character vector of object names

path

The filepath to the directory in which to save or from which to load the objects. The path should be constructed using file.path().

ext

The file extension to use (default is .RData).

quiet

Logical. Should output be suppressed? Default is TRUE.

envir

The environment in which to look for and load objects (default: the environment from which the function was called).

Value

Invisibly if quiet=TRUE. Either a list of objects loaded, empty list if saved, or if removed either 0 for success, 1 for failure.

Details

By default, the extension .RData is used.

Author

Alex Chubaty