View source: R/serialization.R
| loadScalarJson | R Documentation |
Load a scalar from json
This function is intended for advanced use cases in which users require detailed control of sampling algorithms and data structures. Minimal input validation and error checks are performed – users are responsible for providing the correct inputs. For tutorials on the "proper" usage of the stochtree's advanced workflow, we provide several vignettes at https://stochtree.ai/
loadScalarJson(json_object, json_scalar_label, subfolder_name = NULL)
json_object |
Object of class |
json_scalar_label |
Label referring to a particular scalar / string value (i.e. "num_samples") in the overall json hierarchy |
subfolder_name |
(Optional) Name of the subfolder / hierarchy under which vector sits |
R vector
example_scalar <- 5.4
example_json <- createCppJson()
example_json$add_scalar("myscalar", example_scalar)
roundtrip_scalar <- loadScalarJson(example_json, "myscalar")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.