set_unit: set_unit

View source: R/functions_wrapper.R

set_unitR Documentation

set_unit

Description

Specify the unit of a column

Note that no conversion of units will happen if the unit was already set.

Usage

set_unit(model_or_datainfo, column, unit)

Arguments

model_or_datainfo

(Model or DataInfo) Model object or DataInfo object

column

(str) Name of a column. If the column contains multiple variables, e.g. DV with multiple DVs, the ID can be specified with a colon. For example "DV:1" will mean the DV column only when DVID is 1.

unit

(str) The unit

Value

(Model | DataInfo) An updated Model or DataInfo object

See Also

convert_unit - Convert between units for a variable

Examples

## Not run: 
model <- load_example_model("pheno")
model <- set_unit(model, "WGT", "kg")

## End(Not run)

pharmr documentation built on May 28, 2026, 5:08 p.m.