Skip to contents

Write named list to file

Usage

save_yaml(x, file, ..., sorted = FALSE)

Arguments

x

a named list, fastmap2, or anything that can be transformed into named list via as.list

file, ...

passed to write_yaml

sorted

whether to sort the results by name; default is false

Value

Normalized file path

Examples



x <- list(a = 1, b = 2)
f <- tempfile()

save_yaml(x, f)

load_yaml(f)
#> <Map, size=2, keys=[b, a]>

map <- dipsaus::fastmap2(missing_default = NA)
map$c <- 'lol'
load_yaml(f, map = map)
#> <Map, size=3, keys=[b, a, c]>

map$a
#> [1] 1
map$d
#> [1] NA