Learn R Programming

yamlet (version 0.6.5)

decorations.data.frame: Retrieve Decorations for Data Frame

Description

Retrieve the decorations of a data.frame; i.e., the metadata used to decorate it. Returns a list with same names as the data.frame. By default, 'class' and 'level' attributes are excluded from the result, as you likely don't want to manipulate these independently.

Usage

# S3 method for data.frame
decorations(
  x,
  ...,
  exclude_attr = getOption("yamlet_exclude_attr", c("class", "levels"))
)

Arguments

x

data.frame

...

optional unquoted column names to limit output (passed to select)

exclude_attr

attributes to remove from the result

Value

named list of class 'yamlet'

See Also

Other decorate: as_decorated.default(), as_decorated(), decorate.character(), decorate.data.frame(), decorate.list(), decorate(), decorations(), redecorate()

Examples

Run this code
# NOT RUN {
library(csv)
library(magrittr)
file <- system.file(package = 'yamlet', 'extdata','quinidine.csv')
x <- decorate(as.csv(file))[,c('conc','Race')]
y <- decorate(as.csv(file))[,c('conc','Race')] %>% resolve
decorations(x)
decorations(y)
decorations(y, conc)
decorations(y, exclude_attr = NULL)
# }

Run the code above in your browser using DataLab