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
datasetcolumn.- var_spec
A data frame of variable specifications. Required. Must contain at least
datasetandvariablecolumns.- 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.
See also
Other specification:
apply_spec(),
coerce_types(),
decode_var(),
detect_adam_class(),
detect_adam_classes(),
drop_unspec_vars(),
order_cols(),
read_spec(),
read_spec_define(),
scaffold_vars(),
sort_keys(),
spec_codelist(),
spec_datasets(),
spec_study(),
spec_vars(),
write_define_html(),
write_define_xml(),
write_spec()
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"
