decorate.character {yamlet}R Documentation

Decorate Character

Description

Treats x as a file path. By default, metadata is sought from a file with the same base but the 'yaml' extension.

Usage

## S3 method for class 'character'
decorate(
  x,
  meta = NULL,
  ...,
  read = getOption("yamlet_import", as.csv),
  ext = getOption("yamlet_extension", ".yaml")
)

Arguments

x

file path for table data

meta

file path for corresponding yamlet metadata, or a yamlet object

...

passed to read (if accepted) and to as_yamlet.character

read

function or function name for reading x

ext

file extension for metadata file, if relevant

Value

class 'decorated' 'data.frame'

See Also

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

Other interface: canonical.decorated(), classified.data.frame(), decorate.data.frame(), desolve.decorated(), 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(), scripted.default(), selected.default(), write_yamlet()

Examples


# find data file
file <- system.file(package = 'yamlet', 'extdata','quinidine.csv')
file

# find metadata file
meta <- system.file(package = 'yamlet', 'extdata','quinidine.yaml')
meta

# decorate with explicit metadata reference
a <- decorate(file, meta)

# rely on default metadata path
b <- decorate(file)

# in this case: same
stopifnot(identical(a, b))

[Package yamlet version 1.0.3 Index]