canonical.yamlet: Sort Yamlet

View source: R/canonical.R

canonical.yamletR Documentation

Sort Yamlet

Description

Enforces canonical attribute order for class 'yamlet'. Set of default_keys will be augmented with all observed attribute names and will be expanded or reduced as necessary for each data item.

Usage

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

Arguments

x

yamlet

default_keys

attribute names in preferred order

...

ignored

Value

decorated

See Also

Other canonical: canonical.decorated(), canonical()

Examples

library(magrittr)
x <- data.frame(x = 1, y = 1, z = factor('a'))
x %<>% decorate('
x: [ guide: mm, desc: this, label: foo ]
"y": [ guide: bar, desc: other ]
')

decorations(x)
decorations(canonical(x))
canonical(decorations(x))
write_yamlet(x)


yamlet documentation built on April 18, 2022, 5:06 p.m.