as_variable_metadata: Coerce Metadata to the Variable-Metadata Contract

View source: R/metadata.R

as_variable_metadataR Documentation

Coerce Metadata to the Variable-Metadata Contract

Description

Normalizes the accepted metadata inputs into a single tidy table with one row per dataset variable. A metacore object is unpacked into its dataset, variable, and derivation components; a data.frame is checked for the required dataset and variable columns and completed with any missing optional columns.

Usage

as_variable_metadata(metadata)

Arguments

metadata

Either a Metacore object or a data.frame with at least the columns dataset and variable. Optional columns label, type, origin, derivation, and is_derived are used when present.

Value

A tibble with columns dataset, variable, label, type, origin, derivation, and is_derived.

Examples


# The example ADaM metadata shipped in r4subdata.
meta <- as_variable_metadata(r4subdata::adam_metadata)
head(meta)


r4subpharma documentation built on Sept. 11, 2026, 5:08 p.m.