View source: R/utilities-units.R
toBaseUnit | R Documentation |
Converts a value given in a specified unit into the base unit of a quantity
toBaseUnit(
quantityOrDimension,
values,
unit,
molWeight = NULL,
molWeightUnit = NULL
)
quantityOrDimension |
Instance of a quantity from which the dimension will be retrieved or name of dimension |
values |
Value in unit (single or vector) |
unit |
Unit of value |
molWeight |
Optional molecule weight to use when converting, for example, from molar to mass amount or concentration. If |
molWeightUnit |
Unit of the molecular weight value. If |
simPath <- system.file("extdata", "simple.pkml", package = "ospsuite")
sim <- loadSimulation(simPath)
par <- getParameter("Organism|Liver|Volume", sim)
# Converts the value in unit (1000 ml) to the base unit (l) => 1
valueInBaseUnit <- toBaseUnit(par, 1000, "ml")
valuesInBaseUnit <- toBaseUnit(par, c(1000, 2000, 3000), "ml")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.