taml_load | R Documentation |
TAML is a tiny subset of YAML. See https://yihui.org/litedown/#sec:yaml-syntax for its specifications.
taml_load(x, envir = parent.frame())
taml_file(path)
taml_save(x, path = NULL, indent = " ")
x |
For |
envir |
The environment in which R expressions in YAML are evaluated. To
disable the evaluation, use |
path |
A file path to read from or write to. |
indent |
A character string to indent sub-lists by one level. |
taml_load()
and taml_file()
return a list; if path = NULL
,
taml_save()
returns a character vector, otherwise the vector is written
to the file specified by the path
.
(res = taml_load("a: 1"))
taml_save(res)
(res = taml_load("a: 1\nb: \"foo\"\nc: null"))
taml_save(res)
(res = taml_load("a:\n b: false\n c: true\n d: 1.234\ne: bar"))
taml_save(res)
taml_save(res, indent = "\t")
taml_load("a: !expr paste(1:10, collapse = \", \")")
taml_load("a: [1, 3, 4, 2]")
taml_load("a: [1, \"abc\", 4, 2]")
taml_load("a: [\"foo\", \"bar\"]")
taml_load("a: [true, false, true]")
# the other form of array is not supported
taml_load("a:\n - b\n - c")
# and you must use the yaml package
if (loadable("yaml")) yaml_load("a:\n - b\n - c")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.