| load_rocrate_bag | R Documentation |
Load an RO-Crate BagIt archive
load_rocrate_bag(
path,
algo = NULL,
bagit_version = "1.0",
load_content = FALSE,
max_file_size = 10 * 1024^2
)
path |
String with full path to a compressed file contain an RO-Crate bag, see bag_rocrate for details. Alternatively, a path to a directory containing an RO-Crate bag. |
algo |
String with algorithm used to generate the RO-Crate bag
(default: |
bagit_version |
String with version of BagIt used to generate the
RO-Crate bag (default: |
load_content |
Logical. If |
max_file_size |
Maximum file size (bytes) allowed when loading content. Default 10MB. |
An object with the rocrate class.
Other RO-Crate BagIt archive functions:
bag_rocrate(),
is_rocrate_bag(),
unbag_rocrate()
# -------- 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: RO-Crate BagIt archive --------
rocrateR::load_rocrate_bag(path_to_roc_bag)
# -------- INPUT: Path --------
rocrateR::unbag_rocrate(path_to_roc_bag) |>
rocrateR::load_rocrate_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.