Refer to conversion_factors for a full list of available conversions

as_metric(param = NULL, meas = NULL, ..., value_only = FALSE)

Arguments

param

(character) Name of measurement, e.g. param = "SCr"

meas

(units) Measurement or vector of measurements

...

(units) One of conversion_factors$parameter, e.g. SCr = units::set_units(88.4, "umol/l"). Case insensitive.

value_only

(logical) Return as value only without units

Value

(units) Converted measured value or vector of measured values, unless value_only = TRUE

Examples

as_metric(param = "scr", meas = units::set_units(88.4, "umol/l"))
#> 0.9999808 [mg/dl]
as_metric("scr", units::set_units(88.4, "umol/l"))
#> 0.9999808 [mg/dl]

values <- units::set_units(c(60, 70, 80), "umol/l")
as_metric(SCr = values)
#> Units: [mg/dl]
#> [1] 0.67872 0.79184 0.90496