Skip to contents

supports reading data into a map object, and write the map to files with names sorted for consistency

Usage

load_yaml(file, ..., map = NULL)

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

Arguments

file

file to read from or write to

...

passed to as.list

map

a fastmap object; can be generated by fastmap or dipsaus package; default is to create a new map internally

x

list or map to write

sorted

whether to sort the list by name; default is false

Value

A map object

Examples


tfile <- tempfile(fileext = ".yml")

save_yaml(list(b = 2, a = 1), tfile, sorted = TRUE)

cat(readLines(tfile), sep = "\n")
#> a: 1.0
#> b: 2.0

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

unlink(tfile)