as_yamlet.character: Coerce Character To Yamlet Format
Description
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.
Usage
# S3 method for character
as_yamlet(
x,
default_keys = getOption("yamlet_default_keys", list("label", "guide")),
...
)
Value
yamlet: a named list with default keys applied
Arguments
x
length-one filepath or actual data
default_keys
character: default keys for the first n anonymous members of each element
...
passed to as_yam.character and as_yamlet.yam
Details
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.
See Also
Other yamlet:
[.yamlet(),
as.character.yamlet(),
as_yamlet(),
as_yamlet.data.frame(),
as_yamlet.list(),
as_yamlet.yam(),
as_yamlet.yamlet(),
print.yamlet()