unbag_rocrate: 'Unbag' (extract) RO-Crate packed with BagIt

View source: R/utils-bag.R

unbag_rocrateR Documentation

'Unbag' (extract) RO-Crate packed with BagIt

Description

'Unbag' (extract) RO-Crate packed with BagIt

Usage

unbag_rocrate(path, output = dirname(path), quiet = FALSE)

Arguments

path

String with path to compressed file containing an RO-Crate bag.

output

String with target path where the contents will be extracted (default: dirname(path) - same directory as input path).

quiet

Boolean flag to indicate if messages should be suppressed (default: FALSE - display messages).

Value

String with path to root of the RO-Crate.

See Also

Other RO-Crate BagIt archive functions: bag_rocrate(), is_rocrate_bag(), load_rocrate_bag()

Examples

# -------- 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)

rocrateR documentation built on April 9, 2026, 1:06 a.m.