tm_g_ipp | R Documentation |
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.
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(),
transformators = list(),
decorators = list()
)
a teal_module
object.
This module generates the following objects, which can be modified in place using decorators:
plot
(ggplot
)
A Decorator is applied to the specific output using a named list of teal_transform_module
objects.
The name of this list corresponds to the name of the output to which the decorator is applied.
See code snippet below:
tm_g_ipp( ..., # arguments for module decorators = list( plot = teal_transform_module(...) # applied only to `plot` output ) )
For additional details and examples of decorators, refer to the vignette
vignette("decorate-module-output", package = "teal.modules.clinical")
.
To learn more please refer to the vignette
vignette("transform-module-output", package = "teal")
or the teal::teal_transform_module()
documentation.
The TLG Catalog where additional example apps implementing this module can be found.
library(nestcolor)
library(dplyr)
data <- teal_data()
data <- within(data, {
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")
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
ADSL <- data[["ADSL"]]
ADLB <- data[["ADLB"]]
app <- init(
data = data,
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.