# NOT RUN {
library(magrittr)
library(dplyr)
file <- system.file(package = 'yamlet', 'extdata','quinidine.csv')
x <- decorate(file)
# modify selected columns
x %<>% modify(title = paste(label, '(', guide, ')'), time)
x %>% select(time, conc) %>% decorations
# modify (almost) all columns
x %<>% modify(title = paste(label, '(', guide, ')'), -Subject)
x %>% select(time, conc) %>% decorations
# use column itself
x %<>% modify(`defined values` = sum(!is.na(.)))
x %>% select(time) %>% decorations
# rename column
x %<>% modify(time, name = label)
names(x)
# warn if assignment fails
# }
# NOT RUN {
\donttest{
x %<>% modify(title = foo, time)
}
# }
# NOT RUN {
# support lists
list(a = 1, b = 1:10, c = letters) %>%
modify(length = length(.), b:c)
# }
Run the code above in your browser using DataLab