prepare_arm {teal.modules.clinical} | R Documentation |
Expression: Arm Preparation
Description
The function generate the standard expression for pre-processing of dataset
in teal module applications. This is especially of interest when the same
preprocessing steps needs to be applied similarly to several datasets
(e.g. ADSL
and ADRS
).
Usage
prepare_arm(
dataname,
arm_var,
ref_arm,
comp_arm,
compare_arm = !is.null(ref_arm),
ref_arm_val = paste(ref_arm, collapse = "/"),
drop = TRUE
)
Arguments
dataname |
( |
arm_var |
( |
ref_arm |
( |
comp_arm |
( |
compare_arm |
( |
ref_arm_val |
( |
drop |
( |
Details
In teal.modules.clinical
, the user interface includes manipulation of
the study arms. Classically: the arm variable itself (e.g. ARM
, ACTARM
),
the reference arm (0 or more), the comparison arm (1 or more) and the
possibility to combine comparison arms.
Note that when no arms should be compared with each other, then the produced expression is reduced to optionally dropping non-represented levels of the arm.
When comparing arms, the pre-processing includes three steps:
Filtering of the dataset to retain only the arms of interest (reference and comparison).
Optional, if more than one arm is designated as reference they are combined into a single level.
The reference is explicitly reassigned and the non-represented levels of arm are dropped.
Value
a call
Examples
prepare_arm(
dataname = "adrs",
arm_var = "ARMCD",
ref_arm = "ARM A",
comp_arm = c("ARM B", "ARM C")
)
prepare_arm(
dataname = "adsl",
arm_var = "ARMCD",
ref_arm = c("ARM B", "ARM C"),
comp_arm = "ARM A"
)