Filters a decorated data.frame. After a filter operation, promote() is called to see if ambiguous conditional attributes can be improved.
See also
Other promote:
[.decorated(),
promote(),
promote.data.frame(),
promote.list(),
singularity()
Examples
library(magrittr)
file <- system.file(package = 'yamlet', 'extdata','phenobarb.csv')
x <- file %>% decorate
# Note that there are two elements each for value label and value guide.
x %>% decorations(event, value)
#> - event
#> - label: type of event
#> - guide: dose, conc
#> - value
#> - label
#> - event == 'dose': dose of drug administered
#> - event == 'conc': serum phenobarbital concentration
#> - guide
#> - event == 'dose': µg/kg
#> - event == 'conc': µg/L
# Filtering promotes the relevant conditional attributes automatically.
x %>% filter(event == 'dose') %>% decorations(value)
#> - value
#> - label: dose of drug administered
#> - guide: µg/kg
x %>% filter(event == 'conc') %>% decorations(value)
#> - value
#> - label: serum phenobarbital concentration
#> - guide: µg/L