Learn R Programming

yamlet (version 1.2.0)

decorate.list: Decorate List

Description

Decorates a list-like object. Takes metadata in yamlet format and loads it onto corresponding list elements as attributes.

Usage

# S3 method for list
decorate(
  x,
  meta = NULL,
  ...,
  ext = getOption("yamlet_extension", ".yaml"),
  persistence = getOption("yamlet_persistence", FALSE),
  overwrite = getOption("yamlet_overwrite", FALSE)
)

Value

like x but with 'decorated' as first class element

Arguments

x

object inheriting from list

meta

file path for corresponding yaml metadata, or a yamlet or something coercible to yamlet; an attempt will be made to guess the file path if x has a 'source' attribute (as for as.csv)

...

passed to as_yamlet.character (by method dispatch)

ext

file extension for metadata file, if relevant

persistence

whether to coerce decorated items to 'dvec' where suitable method exists

overwrite

whether to overwrite attributes that are already present (else give warning)

Details

As of v0.8.8, attribute persistence is supported by optionally coercing decorated items to class 'dvec' where suitable methods exist. persistence is false by default for the list method but true by default for the data.frame method. See also decorate.data.frame.

See Also

Other decorate: as_decorated(), as_decorated.default(), decorate(), decorate.character(), decorate.data.frame(), 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()

Examples

Run this code
example(decorate.data.frame)

Run the code above in your browser using DataLab