as_yamlet.character | R Documentation |
Coerces character to yamlet format. Length-one character is understood as a file path if the file exists. Otherwise, it is treated as data. The file is a mapping of (nested) sequences, where map keys are data item names, and sequences represent data item attributes. Attributes may be named or anonymous.
## S3 method for class 'character'
as_yamlet(
x,
default_keys = getOption("yamlet_default_keys", list("label", "guide")),
...
)
x |
length-one filepath or actual data |
default_keys |
character: default keys for the first n anonymous members of each element |
... |
passed to |
If an attribute is anonymous, an attempt
is made to name it using available defaults.
A special item named '_keys' if present identifies a sequence of
key names that over-ride default_keys
.
Attribute names are sought first in the explicit yaml,
then in the special item named '_keys',
then in the default_keys
argument passed to as_yamlet
,
then in options()$yamlet_default_keys
,
then in the defaults for argument default_keys
.
yamlet: a named list with default keys applied
Other yamlet:
[.yamlet()
,
as.character.yamlet()
,
as_yamlet.data.frame()
,
as_yamlet.list()
,
as_yamlet.yamlet()
,
as_yamlet.yam()
,
as_yamlet()
,
print.yamlet()
file <- system.file(package = 'yamlet', 'extdata','quinidine.yaml')
as_yamlet(file)
as_yamlet('ID: subject identifier')
as_yamlet(c('id: subject','amt: dose'))
as_yamlet(c('id: subject\namt: dose'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.