loadScalarJson: Load a scalar from json

View source: R/serialization.R

loadScalarJsonR Documentation

Load a scalar from json

Description

Load a scalar from json

Usage

loadScalarJson(json_object, json_scalar_label, subfolder_name = NULL)

Arguments

json_object

Object of class CppJson

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

Value

R vector

Examples

example_scalar <- 5.4
example_json <- createCppJson()
example_json$add_scalar("myscalar", example_scalar)
roundtrip_scalar <- loadScalarJson(example_json, "myscalar")

stochtree documentation built on April 4, 2025, 2:11 a.m.