as_yam.yamlet: Coerce Yamlet to Yam

View source: R/yamlet.R

as_yam.yamletR Documentation

Coerce Yamlet to Yam

Description

Coerces class yamlet to yam, negotiating the default keys. For each member of x, names of sub-members will be dropped if all previous such have been dropped. I.e., attribute order is preserved, and 'guide' (by default) will not be made implicit unless 'label' has already been encountered (and made implicit). Default keys are attached as the 'keys' attribute of the result.

Usage

## S3 method for class 'yamlet'
as_yam(
  x,
  ...,
  default_keys = getOption("yamlet_default_keys", list("label", "guide"))
)

Arguments

x

yamlet

...

ignored

default_keys

names that may be omitted in left subsets

Value

yam

See Also

Other yam: as.character.yam(), as_yam.character(), as_yam()

Examples

as_yam(as_yamlet(c('id: subject','amt: dose')))
as_yam(as_yamlet(c('amt: [ dose, mg ]')))
as_yam(as_yamlet(c('amt: [ guide: mg, label: dose ]')))


yamlet documentation built on Oct. 6, 2023, 9:07 a.m.