convert_flow_unit: Convert flow (e.g. clearance) from / to units

View source: R/convert_flow_unit.R

convert_flow_unitR Documentation

Convert flow (e.g. clearance) from / to units

Description

Flow units are expected to be specified as a combination of volume per time units, potentially specified per kg body weight, e.g. "mL/min", or "L/hr/kg".

Usage

convert_flow_unit(value = NULL, from = "l", to = "ml", weight = NULL)

Arguments

value

flow value

from

from flow unit, e.g. 'L/hr'.

to

to flow unit, e.g. 'mL/min'

weight

for performing per weight (kg) conversion

Details

Accepted volume units are "L", "dL", and "mL". Accepted time units are "min", "hr", and "day". The only accepted weight unit is "kg".

The function is not case-sensitive.

Examples


## single values
convert_flow_unit(60, "L/hr", "ml/min")
convert_flow_unit(1, "L/hr/kg", "ml/min", weight = 80)

## vectorized
convert_flow_unit(
  c(10, 20, 30), 
  from = c("L/hr", "mL/min", "L/hr"), 
  to = c("ml/min/kg", "L/hr", "L/hr/kg"), 
  weight = c(70, 80, 90))
  

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