Skip to contents

Build a herald_spec object from data frames. Maps 1:1 to the 11 tabs in a Pinnacle 21 Excel specification template. Only ds_spec and var_spec are required; all other slots are optional.

Usage

herald_spec(
  ds_spec,
  var_spec,
  study = data.frame(),
  value_spec = NULL,
  codelist = NULL,
  dictionaries = NULL,
  methods = NULL,
  comments = NULL,
  documents = NULL,
  arm_displays = NULL,
  arm_results = NULL
)

Arguments

ds_spec

A data frame of dataset specifications. Required. Must contain at least a dataset column.

var_spec

A data frame of variable specifications. Required. Must contain at least dataset and variable columns.

study

A data frame of study-level metadata (2-column key-value: attribute, value). Optional.

value_spec

A data frame of value-level metadata with where clauses. Optional.

codelist

A data frame of codelist definitions and terms. Optional.

dictionaries

A data frame of external dictionary references. Optional.

methods

A data frame of derivation methods. Optional.

comments

A data frame of comments with document references. Optional.

documents

A data frame of supplemental documents. Optional.

arm_displays

A data frame of ARM analysis display definitions. Optional.

arm_results

A data frame of ARM analysis result metadata. Optional.

Value

A herald_spec object.

Examples

# Minimal spec with one dataset and two variables
spec <- herald_spec(
  ds_spec = data.frame(
    dataset = "DM",
    label = "Demographics",
    stringsAsFactors = FALSE
  ),
  var_spec = data.frame(
    dataset = "DM",
    variable = c("STUDYID", "USUBJID"),
    label = c("Study Identifier", "Unique Subject Identifier"),
    data_type = c("text", "text"),
    order = 1:2,
    stringsAsFactors = FALSE
  )
)
print(spec)
#> 
#> ── herald_spec ──
#> 
#> • Dataset: 1
#> • Variables: 2
#> Datasets: "DM"