Provide either file
or test
. This input will be interpreted as yaml code, barring the exceptions given by the other options.
read.yaml( file = NULL, text = NULL, verbose = FALSE, keep.quotes = TRUE, quote.char = "__QUOTE__", colon.char = NULL, check.by.row = FALSE, utf8 = TRUE )
file | A character vector specifying a file to read from. |
---|---|
text | A character vector to directly interpret with yaml syntax. Takes precedent over |
verbose | Shall the input vector after modifications be shown? This vector is given to |
keep.quotes | Normally quotes are interpreted by yaml. This allows to write quotes as normal and they are handled seperately. |
quote.char | For internal handling quotes are replaced by |
colon.char | For internal handling colons are replaced by |
check.by.row | Allows better error handling by singling through the lines. |
utf8 | If |
colon.handling | There exists the following ways to deal with colons, with
|
colon.replace.exceptions | A vector with exceptions to allow for specified multi-level-yaml structures |
space.after.colon | Should a space after a colon be forced? Caution: This only applies to actually written ":" within the text and not those provided by |
A list according to the provided yaml-structure
text.char = "question: What is 20*20? sc: - 100 - 200 - 400* - 500 success: Great, your answer is correct__COLON__ Super! failure: Try again." read.yaml(text=text.char)#> $question #> [1] "What is 20*20?" #> #> $sc #> $sc[[1]] #> [1] 100 #> #> $sc[[2]] #> [1] 200 #> #> $sc[[3]] #> [1] "400*" #> #> $sc[[4]] #> [1] 500 #> #> #> $success #> [1] "Great, your answer is correct__COLON__ Super!" #> #> $failure #> [1] "Try again." #>