[.decorated | R Documentation |
Subsets decorated. Calls promote
internally to improve ambiguous conditional
attributes where possible.
## S3 method for class 'decorated'
x[..., .promote = getOption("yamlet_promote", TRUE)]
x |
decorated |
... |
passed to next method |
.promote |
whether to auto-promote plural attributes |
decorated (unless dimension is dropped)
Other promote:
filter.decorated()
,
promote.data.frame()
,
promote.list()
,
promote()
,
singularity()
Other decorated:
[<-.decorated()
,
[[.decorated()
,
[[<-.decorated()
,
merge.decorated()
,
names<-.decorated()
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)
# Dimension may be dropped
x[1,1]
# Conventional subsetting
a <- as_decorated(as.list(setNames(letters[1:3], LETTERS[1:3])))
attr(a$B, 'label') <- 'foo'
a <- a[1:3]
attributes(a)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.