add_dataset: Add a dataset to an RO-Crate

View source: R/utils-rocrate.R

add_datasetR Documentation

Add a dataset to an RO-Crate

Description

This helper converts an R object (typically a data.frame) into a dataset inside the RO-Crate. The object is stored in the content field and written to disk when calling extract_content() or bag_rocrate(write_content = TRUE).

Usage

add_dataset(
  rocrate,
  file_id,
  data = NULL,
  name = NULL,
  description = NULL,
  encodingFormat = "text/csv"
)

Arguments

rocrate

RO-Crate object, see rocrate.

file_id

Filename for the dataset file.

data

R object to store (typically a data.frame).

name

Dataset name.

description

Optional dataset description.

encodingFormat

MIME type (default "text/csv").

Details

Use this when you want to register a dataset file or directory as a formal Dataset entity inside the RO-Crate metadata.

Value

Updated RO-Crate object.


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