Learn R Programming

yamlet (version 0.6.5)

as_yam.character: Coerce Character to Yam

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

# S3 method for 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

Run this code
# NOT RUN {
# 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:')

# }

Run the code above in your browser using DataLab