View source: R/convert_flow_unit.R
convert_flow_unit | R Documentation |
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".
convert_flow_unit(value = NULL, from = "l", to = "ml", weight = NULL)
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 |
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.
## 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.