as_yam.character: Coerce Character to Yam

Description Usage Arguments Value See Also Examples

View source: R/yamlet.R

Description

Coerces character to yam. Length-one character can be a filepath, otherwise treated as data. Proceeds by importing the data and determining the default keys.

Usage

1
2
## S3 method for class 'character'
as_yam(x, as.named.list, ...)

Arguments

x

length-one filepath or actual data

as.named.list

enforced as TRUE

...

passed to read_yaml and yaml.load if supported

Value

a named list

See Also

Other yam: as.character.yam(), as_yam.yamlet(), as_yam()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Read sample data from file.
file <- system.file(package = 'yamlet', 'extdata','quinidine.yaml')
file
as_yam(file)

# Read yamlet directly from character vector.
as_yam(c('ID:','TIME:'))

# Read from length-one character (same result).
as_yam('ID:\nTIME:')

yamlet documentation built on July 19, 2021, 1:06 a.m.