Skip to contents

This function generates the standard expression for pre-processing of dataset arm levels in and is used to apply the same steps in safety teal modules.

Usage

prepare_arm_levels(dataname, parentname, arm_var, drop_arm_levels = TRUE)

Arguments

dataname

(character)
analysis data used in teal module.

parentname

(character)
parent analysis data used in teal module, usually this refers to ADSL.

arm_var

(character)
variable names that can be used as arm_var.

drop_arm_levels

(logical)
drop the unused arm_var levels. When TRUE, arm_var levels are set to those used in the dataname dataset. When FALSE, arm_var levels are set to those used in the parantname dataset.

Examples

if (FALSE) {
teal.modules.clinical::prepare_arm_levels(
  dataname = "adae",
  parentname = "adsl",
  arm_var = "ARMCD",
  drop_arm_levels = TRUE
)

teal.modules.clinical::prepare_arm_levels(
  dataname = "adae",
  parentname = "adsl",
  arm_var = "ARMCD",
  drop_arm_levels = FALSE
)
}