% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions_wrapper.R
\name{convert_unit}
\alias{convert_unit}
\title{convert_unit}
\usage{
convert_unit(model, variable, unit, original_unit = NULL, in_dataset = FALSE)
}
\arguments{
\item{model}{(Model) Pharmpy model}

\item{variable}{(str) Which variable in the dataset or the model code to convert}

\item{unit}{(str or Unit) The new unit}

\item{original_unit}{(str or Unit (optional)) If no original unit is available in the datainfo this will be used}

\item{in_dataset}{(logical) Set to TRUE if the conversion should be done in the dataset instead of in model code}
}
\value{
(Model) Updated Pharmpy model
}
\description{
Convert between units for a data variable

The conversion could either be handled in the model code or optionally in the dataset (if applicable).
}
\examples{
\dontrun{
model <- load_example_model("pheno")
model <- convert_unit(model, "WGT", "g")
}

}
