recode_categorical_covariates: Recode categorical covariates levels

View source: R/utils.R

recode_categorical_covariatesR Documentation

Recode categorical covariates levels

Description

Change the name of categorical covariates levels.

Usage

recode_categorical_covariates(run, covariates_levels = NULL)

Arguments

run

pmxploit NONMEM run object.

covariates_levels

list of categorical covariates, each list item contains the corresponding categorical levels.

Value

A NONMEM run object.

Examples

recoded_EXAMPLERUN <-
 recode_categorical_covariates(run = EXAMPLERUN,
                               covariates_levels =
                                    list(STUD = list(`Study 1` = "1",
                                                      `Study 2` = "2",
                                                      `Study 3` = "3")))

# before
EXAMPLERUN %>%
  group_by(STUD) %>%
  plot_parameters_distributions(type = "boxplot", parameters = "CL")
# after
recoded_EXAMPLERUN %>%
  group_by(STUD) %>%
  plot_parameters_distributions(type = "boxplot", parameters = "CL")

pnolain/pmxploit documentation built on Jan. 31, 2024, 1:16 p.m.