MyNixOS website logo
Description

Tools for Creating and Manipulating RO-Crates.

Provides tools for creating, manipulating and reading Research Object Crates (RO-Crates), a lightweight approach to packaging research data with structured metadata. Includes utilities for metadata generation, entity management, validation and reading existing RO-Crates following the specification <https://w3id.org/ro/crate/1.2/>.

rocrateR: Tools for Creating and Manipulating RO-Crates logo

CRANstatus R-CMD-check Codecov testcoverage Lifecycle:experimental

{rocrateR} provides a native R interface for creating, manipulating, validating and packaging RO-Crates. RO-Crate is a lightweight approach to packaging research data with structured metadata using JSON-LD.

Installation

You can install the released version of {rocrateR} from CRAN with:

install.packages("rocrateR")

And the development version from GitHub with:

# install.packages("pak")
pak::pak("ResearchObject/ro-crate-r@dev")

Quick Start

# create a crate
crate <- rocrateR::rocrate()

crate <- crate |>
  # add a dataset entity
  rocrateR::add_dataset("iris.csv", iris) |>
  # add workflow entity
  rocrateR::add_workflow(
    file_id = "analysis.R",
    name = "Data analysis pipeline",
    content = c(
      "data <- read.csv('iris.csv')",
      "summary(data)"
    )
  ) |>
  # add software entity
  rocrateR::add_software("R", version = R.version.string)

# write to disk
path_to_rocrate_bag <- rocrateR::bag_rocrate(crate, path = "./my_roc")

path_to_rocrate_bag_contents <- path_to_rocrate_bag |>
    rocrateR::unbag_rocrate(output = "ROC")
#> ROC
#> ├── bag-info.txt
#> ├── bagit.txt
#> ├── data
#> │   ├── analysis.R
#> │   ├── iris.csv
#> │   └── ro-crate-metadata.json
#> ├── manifest-sha512.txt
#> └── tagmanifest-sha512.txt

What You Can Do

  • 📦 Create RO-Crates from projects or folders
  • 📄 Add datasets, software, workflows, notebooks, authors
  • ✏️ Edit and enrich metadata
  • 🔍 Inspect crate contents
  • ✅ Validate structure and metadata
  • 🧳 Create RO-Crate Bags for preservation

Typical Workflow

roc_bag_path <- rocrateR::crate_project() |>
  rocrateR::add_author("Alice Smith") |>
  rocrateR::add_dataset("data/raw.csv") |>
  rocrateR::add_software("analysis.R") |>
  rocrateR::bag_rocrate(path = ".")

Validation

rocrateR::validate_rocrate(roc_bag_path)

Learn More

For further details, see the following vignette:

vignette("getting-started-with-rocrateR")

Why rocrateR?

  • Native R interface to RO-Crate
  • No external system dependencies
  • Supports BagIt packaging (RFC 8493)
  • Structural validation tools
  • Designed for reproducible research workflows.
Metadata

Version

0.1.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows