Learn R Programming

yamlet (version 1.2.0)

as_yam.yamlet: 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 yamlet
as_yam(
  x,
  ...,
  default_keys = getOption("yamlet_default_keys", list("label", "guide"))
)

Value

yam

Arguments

x

yamlet

...

ignored

default_keys

names that may be omitted in left subsets

See Also

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

Examples

Run this code
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 ]')))

Run the code above in your browser using DataLab