spec_methods: Derivation methods in a spec

View source: R/spec_accessors.R

spec_methodsR Documentation

Derivation methods in a spec

Description

Return the method definitions a specification carries. Variables and value-level rows reference these by method_id; validate_spec() checks that every reference resolves and that each referenced method is complete (has a description).

Usage

spec_methods(spec)

Arguments

spec

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

Value

A data frame of method metadata, one row per method, with all eight columns: method_id, description, name, type, expression_context, expression_code, document_id, pages. Empty when the spec defines no methods.

See Also

spec_comments(), spec_documents(), validate_spec().

Examples

# ---- Example 1: the methods a spec defines ----
#
# Build a spec with one derivation method and read it back.
spec <- artoo_spec(
  data.frame(dataset = "ADSL"),
  data.frame(dataset = "ADSL", variable = "AGEGR1", data_type = "string"),
  methods = data.frame(
    method_id = "MT.AGEGR1",
    description = "Age group from AGE.",
    stringsAsFactors = FALSE
  )
)
spec_methods(spec)


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