as_yam.character | R Documentation |
Coerces character to yam. Length-one character can be a filepath, otherwise treated as data. Proceeds by importing the data and determining the default keys.
## S3 method for class 'character'
as_yam(
x,
as.named.list,
handlers = list(seq = parsimonious, map = function(x) lapply(x, unclass), str =
function(x) {
if (identical(x, "yamlet_NA_literal_")) {
return("NA")
}
if (identical(x, "NA")) {
return(NA_character_)
}
return(x)
}),
...
)
x |
length-one filepath or actual data |
as.named.list |
enforced as TRUE |
... |
passed to |
a named list
Other yam:
as.character.yam()
,
as_yam.yamlet()
,
as_yam()
# Read sample data from file.
file <- system.file(package = 'yamlet', 'extdata','quinidine.yaml')
file
as_yam(file)
# Read yamlet directly from character vector.
as_yam(c('ID:','TIME:'))
# Read from length-one character (same result).
as_yam('ID:\nTIME:')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.