Skip to contents

Build a weight value object for create_individual()'s weight argument (or the writable Individual$weight / OriginData$weight field). Fills the OriginData Weight characteristic (list(Value =, Unit =)).

Usage

weight(value, unit = "kg")

Arguments

value

Numeric scalar. Weight value.

unit

Character. Unit for weight, validated against dimension "Mass". Defaults to "kg".

Value

A weight_spec object to pass to create_individual().

Examples

weight(70)
#> $value
#> [1] 70
#> 
#> $unit
#> [1] "kg"
#> 
#> attr(,"class")
#> [1] "weight_spec"    "osp_value_spec"
create_individual(name = "Subject", weight = weight(70))
#> 
#> ── Individual: Subject ─────────────────────────────────────────────────────────
#> 
#> ── Characteristics ──
#> 
#> • Weight: 70 kg