| YAMLClass-class | R Documentation |
If the object has the param, then return it. If the param is unknown, create it with the given default value and return the default.
yamlObjA Yaml object as created by yaml.load
getYAML(param_name, default, min = NA, max = NA)Query this YAML object for a certain parameter and return its value. If it does not exist it is created with a default value. An optional min/max range can be specified and will be enforced if the value is known (default will be used upon violation).
setYAML(param_name, value)Set a YAML parameter to a certain value. Overwrites the old value or creates a new entry if hithero unknown.
writeYAML(filename)Write YAML config (including some documentation) to a YAML file. Returns TRUE on success (always), unless writing the file generates an error.
yc = YAMLClass$new(list())
val = yc$getYAML("cat$subCat", "someDefault")
val ## someDefault
val = yc$setYAML("cat$subCat", "someValue")
val ## someValue
yc$getYAML("cat$subCat", "someDefault") ## still 'someValue' (since its set already)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.