as_metric {epocakir}R Documentation

Convert a measured value to metric units

Description

Refer to conversion_factors for a full list of available conversions

Usage

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"))
as_metric("scr", units::set_units(88.4, "umol/l"))

values <- units::set_units(c(60, 70, 80), "umol/l")
as_metric(SCr = values)

[Package epocakir version 0.9.9 Index]