Last chance! 50% off unlimited learning
Sale ends in
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.
# S3 method for yamlet
canonical(
x,
default_keys = getOption("yamlet_default_keys", list("label", "guide")),
...
)
decorated
yamlet
attribute names in preferred order
ignored
Other canonical:
canonical()
,
canonical.decorated()
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)
Run the code above in your browser using DataLab