| yaml_emit | R Documentation |
yaml_emit() converts one R object to a YAML document. yaml_emit_all()
converts a list of objects to a YAML stream.
yaml_emit(
x,
indent = 2L,
width = 80L,
document_start = FALSE,
document_end = FALSE
)
yaml_emit_all(
x,
indent = 2L,
width = 80L,
document_start = FALSE,
document_end = FALSE
)
x |
An R object. |
indent |
Spaces per indentation level, 1 to 255. |
width |
Line width before wrapping, 0 to 255. |
document_start |
Emit a leading |
document_end |
Emit a trailing |
Emission favours readable YAML over reproducing any particular source
formatting. Comments, quoting style and flow-versus-block choices are not
preserved; see vignette("zuyaml") for the conversions that do not round
trip.
A length-one UTF-8 character vector.
cat(yaml_emit(list(host = "localhost", port = 8080L)))
cat(yaml_emit_all(list(list(a = 1L), list(b = 2L))))
# Strings that look like other types stay strings.
cat(yaml_emit(list(version = "42")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.