tm_g_ipp {teal.modules.clinical} | R Documentation |
teal Module: Individual Patient Plots
Description
This module produces ggplot2::ggplot()
type individual patient plots that display trends in parameter
values over time for each patient, using data with ADaM structure.
Usage
tm_g_ipp(
label,
dataname,
parentname = ifelse(inherits(arm_var, "data_extract_spec"),
teal.transform::datanames_input(arm_var), "ADSL"),
arm_var,
paramcd,
id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
"USUBJID"), "USUBJID", fixed = TRUE),
visit_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
"AVISIT"), "AVISIT", fixed = TRUE),
aval_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
"AVAL"), "AVAL", fixed = TRUE),
avalu_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
"AVALU"), "AVALU", fixed = TRUE),
base_var = lifecycle::deprecated(),
baseline_var =
teal.transform::choices_selected(teal.transform::variable_choices(dataname, "BASE"),
"BASE", fixed = TRUE),
add_baseline_hline = FALSE,
separate_by_obs = FALSE,
suppress_legend = FALSE,
add_avalu = TRUE,
plot_height = c(1200L, 400L, 5000L),
plot_width = NULL,
pre_output = NULL,
post_output = NULL,
ggplot2_args = teal.widgets::ggplot2_args()
)
Arguments
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
paramcd |
( |
id_var |
( |
visit_var |
( |
aval_var |
( |
avalu_var |
( |
base_var |
|
baseline_var |
( |
add_baseline_hline |
( |
separate_by_obs |
( |
suppress_legend |
( |
add_avalu |
( |
plot_height |
( |
plot_width |
( |
pre_output |
( |
post_output |
( |
ggplot2_args |
( For more details, see the vignette: |
Value
a teal_module
object.
See Also
The TLG Catalog where additional example apps implementing this module can be found.
Examples
library(nestcolor)
library(dplyr)
ADSL <- tmc_ex_adsl %>%
slice(1:20) %>%
df_explicit_na()
ADLB <- tmc_ex_adlb %>%
filter(USUBJID %in% ADSL$USUBJID) %>%
df_explicit_na() %>%
filter(AVISIT != "SCREENING")
app <- init(
data = cdisc_data(
ADSL = ADSL,
ADLB = ADLB,
code = "
ADSL <- tmc_ex_adsl %>% slice(1:20) %>% df_explicit_na()
ADLB <- tmc_ex_adlb %>% filter(USUBJID %in% ADSL$USUBJID) %>%
df_explicit_na() %>% filter(AVISIT != \"SCREENING\")
"
),
modules = modules(
tm_g_ipp(
label = "Individual Patient Plot",
dataname = "ADLB",
arm_var = choices_selected(
value_choices(ADLB, "ARMCD"),
"ARM A"
),
paramcd = choices_selected(
value_choices(ADLB, "PARAMCD"),
"ALT"
),
aval_var = choices_selected(
variable_choices(ADLB, c("AVAL", "CHG")),
"AVAL"
),
avalu_var = choices_selected(
variable_choices(ADLB, c("AVALU")),
"AVALU",
fixed = TRUE
),
id_var = choices_selected(
variable_choices(ADLB, c("USUBJID")),
"USUBJID",
fixed = TRUE
),
visit_var = choices_selected(
variable_choices(ADLB, c("AVISIT")),
"AVISIT"
),
baseline_var = choices_selected(
variable_choices(ADLB, c("BASE")),
"BASE",
fixed = TRUE
),
add_baseline_hline = FALSE,
separate_by_obs = FALSE
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}