| decorate.data.frame | R Documentation |
Decorates a data.frame. Expects metadata in yamlet format, and loads it onto columns as attributes.
## S3 method for class 'data.frame'
decorate(
x,
meta = NULL,
...,
persistence = getOption("yamlet_persistence", TRUE)
)
x |
data.frame |
meta |
file path for corresponding yaml metadata, or a yamlet; an attempt will be made to guess the file path if x has a 'source' attribute |
... |
passed to |
persistence |
whether to coerce decorated columns to 'dvec' where suitable method exists |
As of v0.8.8, the data.frame method for decorate()
coerces affected columns using as_dvec
if persistence is true and a suitable method
exists. 'vctrs' methods are implemented for class
dvec to help attributes persist during
tidyverse operations. Details are described in
c.dvec. Disable this functionality
with options(yamlet_persistence = FALSE).
class 'decorated' 'data.frame'
decorate.list
Other interface:
canonical.decorated(),
classified.data.frame(),
decorate.character(),
desolve.decorated(),
enscript.default(),
ggplot.decorated(),
io_csv.character(),
io_csv.data.frame(),
io_res.character(),
io_res.decorated(),
io_table.character(),
io_table.data.frame(),
io_yamlet.character(),
io_yamlet.data.frame(),
is_parseable.default(),
mimic.default(),
modify.default(),
promote.list(),
read_yamlet(),
resolve.decorated(),
selected.default(),
write_yamlet()
Other decorate:
as_decorated(),
as_decorated.default(),
decorate(),
decorate.character(),
decorate.list(),
decorate_groups(),
decorate_groups.data.frame(),
decorations(),
decorations.data.frame(),
decorations_groups(),
decorations_groups.data.frame(),
group_by_decorations(),
group_by_decorations.data.frame(),
redecorate()
# find data path
library(csv)
file <- system.file(package = 'yamlet', 'extdata','quinidine.csv')
file
dat <- as.csv(file) # dat now has 'source' attribute
# use source attribute to find metadata
a <- decorate(as.csv(file))
# supply metadata path (or something close) explicitly
b <- decorate(dat, meta = file)
# these are equivalent
stopifnot(identical(a, b))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.