Description Usage Format Initialization Methods Examples
Carry around your data
1 |
An object of class R6ClassGenerator
of length 24.
satchel <- Satchel$new("<namespace>", "<path/to/satchel>")
The namespace will be the name of the folder/namespace that will be used to store the data elements
the path must already exist, this is to protect random satchel directories from being created in the case that the wrong directory path is set
methods:
save(data, data_name) - save data
use(data_name, namespace) - use data saved from a different location
use_batch(data_names) - a vector of data objects to use
report() - show information about all data saved in current session
details() - list all data in the satchel cache directory
preview(data_name, namespace) - shows the (approximate) head of a dataset stored in the output metadata
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
# create a new satchel stored as namespace f1 in the dir data/derived
satchel <- Satchel$new("f1", "../data/derived/satchel")
satchel$save(Theoph)
# new file at ../data/derived/satchel/f1/Theoph.rds
# we can also give the files other names
satchel$save(Theoph, data_name = "other")
satchel$save(Theoph, data_name = "another")
# to see all objects saved during the session can check the report
satchel$report()
# can see data from any satchel dir by checking what is available
satchel$available()
# lets say in another file I had saved a file nca_summaries in an nca_analysis namespace
# satchel is smart enough to scan all folders for that file
nca_summaries <- satchel$use("nca_summaries")
# if it finds a conflict, you must explicitly specify which namespace it was saved under
nca_summaries <- satchel$use("nca_summaries", "nca_analysis")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.