Learn R Programming

yamlet (version 0.6.5)

decorate.data.frame: Decorate Data Frame

Description

Decorates a data.frame. Expects metadata in yamlet format, and loads it onto columns as attributes.

Usage

# S3 method for data.frame
decorate(x, meta = NULL, ...)

Arguments

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 decorate.list

Value

class 'decorated' 'data.frame'

See Also

decorate.list

Other interface: classified.data.frame(), decorate.character(), desolve.decorated(), ggplot.decorated(), io_csv.character(), io_csv.data.frame(), io_res.character(), io_table.character(), io_table.data.frame(), io_yamlet.character(), io_yamlet.data.frame(), is_parseable.default(), mimic.default(), modify.default(), promote.default(), read_yamlet(), resolve.decorated(), selected.default(), write_yamlet()

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

Examples

Run this code
# NOT RUN {
library(csv)
file <- system.file(package = 'yamlet', 'extdata','quinidine.csv')
meta <- system.file(package = 'yamlet', 'extdata','quinidine.yaml')
a <- decorate(as.csv(file))
b <- decorate(as.csv(file), meta = as_yamlet(meta))
c <- decorate(as.csv(file), meta = meta)
d <- decorate(as.csv(file), meta = file)
e <- resolve(decorate(as.csv(file)))

# Most import methods are equivalent.
identical(a, b)
identical(a, c)
identical(a, d)
identical(a, e)
# }

Run the code above in your browser using DataLab