decorate.list: Decorate List

View source: R/decorate.R

decorate.listR Documentation

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 class 'list'
decorate(
  x,
  meta = NULL,
  ...,
  ext = getOption("yamlet_extension", ".yaml"),
  persistence = getOption("yamlet_persistence", FALSE),
  overwrite = getOption("yamlet_overwrite", FALSE)
)

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.

Value

like x but with 'decorated' as first class element

See Also

Other decorate: as_decorated.default(), as_decorated(), decorate.character(), decorate.data.frame(), decorate_groups.data.frame(), decorate_groups(), decorate(), decorations.data.frame(), decorations_groups.data.frame(), decorations_groups(), decorations(), group_by_decorations.data.frame(), group_by_decorations(), redecorate()

Examples

example(decorate.data.frame)


yamlet documentation built on Oct. 6, 2023, 9:07 a.m.