R/extdata.R
save_nl_in_parts.Rd
Save a neuronlist object into separate data and metadata parts
save_nl_in_parts(
x,
datapath = NULL,
dfpath = NULL,
extdata = TRUE,
format = c("rds", "rda"),
...
)
A neuronlist object to save in separate parts
Optional path to new data file (constructed from name of
x
argument when missing)
Optional path to new metadata file (constructed from
datapath
when missing)
Logical indicating whether the files should be saved into
extdata folder (default TRUE
, when FALSE
the paths are
untouched)
Either 'rds'
(default) or 'rda'
.
Additional arguments passed to saveRDS
or
save
(based on the value of format
).
character vector with path to the saved files (returned invisibly)
Saves a neuronlist into separate data and metadata parts. This can
significantly mitigate git repository bloat since only the metadata object
will change when any metadata is updated. By default the objects will be
saved into the package inst/extdata
folder with sensible names based
on the incoming object. E.g. if x=mypns
the files will be
mypns.rds
mypns.df.rds
Other extdata:
find_extdata()
,
read_nl_from_parts()
if (FALSE) { # \dontrun{
save_nl_in_parts(pns)
# which would make:
# - inst/extdata/pns.rds
# - inst/extdata/pns.df.rds
save_nl_in_parts(pns, format='rda')
# which would make:
# - inst/extdata/pns.rda
# - inst/extdata/pns.df.rda
save_nl_in_parts(pns, 'mypns.rda')
# which would make (NB format argument wins):
# - inst/extdata/mypns.rds
# - inst/extdata/mypns.df.rds
} # }