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.
See also
Other canonical:
canonical(),
canonical.decorated()
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)
#> - x
#> - guide: mm
#> - desc: this
#> - label: foo
#> - y
#> - guide: bar
#> - desc: other
#> - z: []
decorations(canonical(x))
#> - x
#> - label: foo
#> - guide: mm
#> - desc: this
#> - y
#> - guide: bar
#> - desc: other
#> - z: []
canonical(decorations(x))
#> - x
#> - label: foo
#> - guide: mm
#> - desc: this
#> - y
#> - guide: bar
#> - desc: other
#> - z: []
write_yamlet(x)
#> x: [ foo, mm, desc: this ]
#> 'y': [ guide: bar, desc: other ]
#> z: