| unbag_rocrate | R Documentation |
'Unbag' (extract) RO-Crate packed with BagIt
unbag_rocrate(path, output = dirname(path), quiet = FALSE)
path |
String with path to compressed file containing an RO-Crate bag. |
output |
String with target path where the contents will be extracted
(default: |
quiet |
Boolean flag to indicate if messages should be suppressed
(default: |
String with path to root of the RO-Crate.
Other RO-Crate BagIt archive functions:
bag_rocrate(),
is_rocrate_bag(),
load_rocrate_bag()
# -------- SETUP --------
basic_crate <- rocrateR::rocrate()
# temp file
tmp_dir <- file.path(tempdir(), digest::digest(basename(tempfile())))
tmp <- file.path(tmp_dir, "ro-crate-metadata.json")
dir.create(tmp_dir)
# bag RO-Crate
path_to_roc_bag <- rocrateR::bag_rocrate(basic_crate, path = tmp_dir)
# -------- INPUT: Path --------
rocrateR::unbag_rocrate(path_to_roc_bag)
# delete temp directory
unlink(tmp_dir, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.