Skip to contents

Build a measurement-values value object for create_observed_data()'s values argument. Carries the measurement y-values, their dimension, and an optional unit.

The dimension is required and has no default; it gates unit validation and is written to the data-set column. When unit is supplied it is validated against dimension via validate_unit().

Usage

values(value, unit = NULL, dimension)

Arguments

value

Numeric vector. Measurement y-values.

unit

Character. Optional unit for value. When supplied, validated against dimension.

dimension

Character. Dimension for value (for example "Concentration (mass)"). Required: pass one of the names of ospsuite::ospDimensions.

Value

A values_spec object to pass to create_observed_data().

Examples

values(c(0, 12, 18, 11, 5), unit = "mg/l", dimension = "Concentration (mass)")
#> $value
#> [1]  0 12 18 11  5
#> 
#> $unit
#> [1] "mg/l"
#> 
#> $dimension
#> [1] "Concentration (mass)"
#> 
#> attr(,"class")
#> [1] "values_spec"    "osp_value_spec"