| bag_rocrate | R Documentation |
Bag the contents of an RO-Crate using the BagIt file packaging format v1.0. For more details see the definition: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.17487/RFC8493")}
bag_rocrate(x, ...)
## S3 method for class 'character'
bag_rocrate(x, ..., output = x, force_bag = FALSE, extra_bag_info = NULL)
## S3 method for class 'rocrate'
bag_rocrate(
x,
...,
path,
output = path,
overwrite = FALSE,
force_bag = FALSE,
extra_bag_info = NULL,
write_content = TRUE,
create_dir = TRUE
)
x |
A string to a path containing at the very minimum an RO-Crate
metadata descriptor file, |
... |
Additional parameters, see below. |
output |
String with path where the RO-Crate bag will be stored
(default: |
force_bag |
Boolean flag to indicate whether the force the creation of
a 'bag' even if not all the files were successfully bagged
(default: |
extra_bag_info |
Vector of strings to include in the |
path |
String with path to the root of the RO-Crate. |
overwrite |
Boolean flag to indicate if the RO-Crate metadata descriptor
file should be overwritten if already inside |
write_content |
Logical. If TRUE, write |
create_dir |
Boolean flag to indicate if the |
String with full path to the RO-Crate bag.
Other RO-Crate BagIt archive functions:
is_rocrate_bag(),
load_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)
# -------- INPUT: RO-Crate --------
rocrateR::bag_rocrate(basic_crate, path = tmp_dir)
# -------- INPUT: Path --------
rocrateR::bag_rocrate(tmp_dir, output = tmp_dir)
# 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.