Skip to contents

Imports yamlet. Character method for io_yamlet. Similar to read_yamlet, but only reads files.

Usage

# S3 method for class 'character'
io_yamlet(
  x,
  default_keys = getOption("yamlet_default_keys", list("label", "guide")),
  ...
)

Arguments

x

file path for yamlet

default_keys

character: default keys for the first n anonymous members of each element

...

passed to as_yamlet

Value

yamlet: a named list with default keys applied

Examples

example(io_yamlet)
#> 
#> i_ymlt> file <- system.file(package = 'yamlet', 'extdata','quinidine.yaml')
#> 
#> i_ymlt> x <- io_yamlet(file)
#> 
#> i_ymlt> tmp <- tempdir()
#> 
#> i_ymlt> out <- file.path(tmp, 'tmp.yaml')
#> 
#> i_ymlt> # we can losslessly 'round-trip' x using to generic calls
#> i_ymlt> identical(x, io_yamlet(io_yamlet(x, out)))
#> [1] TRUE