Learn R Programming

yamlet (version 1.2.1)

decorate.character: 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 character
decorate(
  x,
  meta = NULL,
  ...,
  read = getOption("yamlet_import", as.csv),
  ext = getOption("yamlet_extension", ".yaml")
)

Value

class 'decorated' 'data.frame'

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

See Also

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

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

Examples

Run this code

# 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))

Run the code above in your browser using DataLab