Subsets decorated. Calls promote
internally to improve ambiguous conditional
attributes where possible.
# S3 method for decorated
[(x, ..., .promote = getOption("yamlet_promote", TRUE))object to subset
passed to next method
whether to auto-promote plural attributes
decorated
Other promote:
filter.decorated(),
promote.default(),
promote(),
singularity()
# NOT RUN {
library(magrittr)
file <- system.file(package = 'yamlet', 'extdata','phenobarb.csv')
x <- file %>% decorate
x %>% decorations(event, value)
# Subsetting promotes automatically.
x[x$event == 'dose',] %>% decorations(event, value)
x[x$event == 'conc',] %>% decorations(event, value)
# }
Run the code above in your browser using DataLab