R/loading.R
load_fcdata.Rd
Load an rda/rds object cached on disk into the Global Environment
load_fcdata(data, Force = FALSE, folder = c("data", "db"), envir = .GlobalEnv, inherits = TRUE)
data | Name of object (and the stem of rda file). |
---|---|
Force | Whether to load even if table already exists (default FALSE). |
folder | Name of the project subfolder containing object. |
envir | The environment into which the contents of an rda (but not rds)
file should be loaded. Defaults to |
inherits | Whether to check the enclosing frames of the environment
specified by |
For rda files, a character vector of the names of objects created, invisibly or NULL if nothing loaded. For rds files, the object itself.
if object.rda and object.rds both exist on disk, the former will take priority.
Starts by checking whether an object of the appropiate name is
already loaded in the specified environment unless Force=TRUE
. Note
that only the name is inspected and there is no way to check if the object
matches the one on disk implied by the call i.e. if you create a different
object with a name matching one that you would like to use with
load_fcdata
, the object you want will be masked by the one in memory
and will not be loaded.