View source: R/functions_wrapper.R
| convert_unit | R Documentation |
Convert between units for a data variable
The conversion could either be handled in the model code or optionally in the dataset (if applicable).
convert_unit(model, variable, unit, original_unit = NULL, in_dataset = FALSE)
model |
(Model) Pharmpy model |
variable |
(str) Which variable in the dataset or the model code to convert |
unit |
(str or Unit) The new unit |
original_unit |
(str or Unit (optional)) If no original unit is available in the datainfo this will be used |
in_dataset |
(logical) Set to TRUE if the conversion should be done in the dataset instead of in model code |
(Model) Updated Pharmpy model
## Not run:
model <- load_example_model("pheno")
model <- convert_unit(model, "WGT", "g")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.