convert_albumin_unit: Convert albumin from / to units

View source: R/convert_albumin_unit.R

convert_albumin_unitR Documentation

Convert albumin from / to units

Description

Accepted units are "g_l", "g_dl", or "micromol_l". Arguments supplied to 'value' and 'unit_in' units must be of the same length. "To" unit must be of length 1. #'

Usage

convert_albumin_unit(
  value,
  unit_in = valid_units("serum_albumin"),
  unit_out = valid_units("serum_albumin")
)

Arguments

value

albumin measurements

unit_in

from unit, e.g. '"g_l"'.

unit_out

to flow unit, e.g. '"g_dl"'

Examples


## single values
convert_albumin_unit(0.6, "g_dl", "g_l")

## vectorized
convert_albumin_unit(
  c(0.4, 2, 0.3), 
  unit_in = c("g_dl", "g_l", "g_dl"),
  unit_out = c("g_l")
)
  

InsightRX/clinPK documentation built on April 24, 2024, 6:01 p.m.