spec_comments: Comment definitions in a spec

View source: R/spec_accessors.R

spec_commentsR Documentation

Comment definitions in a spec

Description

Return the comment definitions a specification carries. Datasets, variables, value-level rows, and codelists reference these by comment_id; validate_spec() checks the references resolve and each referenced comment has a body.

Usage

spec_comments(spec)

Arguments

spec

The specification to read. ⁠<artoo_spec>: required⁠.

Value

A data frame of comment metadata, one row per comment, with all four columns: comment_id, description, document_id, pages. Empty when the spec defines no comments.

See Also

spec_methods(), spec_documents(), validate_spec().

Examples

# ---- Example 1: the comments a spec defines ----
#
# Build a spec with one comment and read it back.
spec <- artoo_spec(
  data.frame(dataset = "ADSL"),
  data.frame(dataset = "ADSL", variable = "AGE", data_type = "integer"),
  comments = data.frame(
    comment_id = "C.AGE",
    description = "Age in years at informed consent.",
    stringsAsFactors = FALSE
  )
)
spec_comments(spec)


artoo documentation built on July 23, 2026, 1:08 a.m.