Enforces canonical attribute order for class 'decorated'. 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.yamlet()
Other interface:
classified.data.frame(),
decorate.character(),
decorate.data.frame(),
desolve.decorated(),
enscript.decorated(),
ggplot.decorated(),
io_csv.character(),
io_csv.data.frame(),
io_res.character(),
io_res.decorated(),
io_table.character(),
io_table.data.frame(),
io_yamlet.character(),
io_yamlet.data.frame(),
is_parseable.default(),
mimic.default(),
modify.default(),
promote.list(),
read_yamlet(),
resolve.decorated(),
selected.default(),
write_yamlet()
Examples
# make some decorated data
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 ]
')
# retrieve decorations: label not first!
decorations(x)
#> - x
#> - guide: mm
#> - desc: this
#> - label: foo
#> - y
#> - guide: bar
#> - desc: other
#> - z: []
# sort label first by default
decorations(canonical(x))
#> - x
#> - label: foo
#> - guide: mm
#> - desc: this
#> - y
#> - guide: bar
#> - desc: other
#> - z: []
# equivalent invocation
canonical(decorations(x))
#> - x
#> - label: foo
#> - guide: mm
#> - desc: this
#> - y
#> - guide: bar
#> - desc: other
#> - z: []