tm_g_lineplot {teal.modules.clinical} | R Documentation |
teal Module: Line Plot
Description
This module produces a ggplot2::ggplot()
type line plot, with optional summary table, for standard ADaM data.
Usage
tm_g_lineplot(
label,
dataname,
parentname = ifelse(inherits(strata, "data_extract_spec"),
teal.transform::datanames_input(strata), "ADSL"),
strata = teal.transform::choices_selected(teal.transform::variable_choices(parentname,
c("ARM", "ARMCD", "ACTARMCD")), "ARM"),
x = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
"AVISIT"), "AVISIT", fixed = TRUE),
y = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
c("AVAL", "BASE", "CHG", "PCHG")), "AVAL"),
y_unit = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
"AVALU"), "AVALU", fixed = TRUE),
paramcd = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
"PARAMCD"), "PARAMCD", fixed = TRUE),
param = teal.transform::choices_selected(teal.transform::value_choices(dataname,
"PARAMCD", "PARAM"), "ALT"),
conf_level = teal.transform::choices_selected(c(0.95, 0.9, 0.8), 0.95, keep_order =
TRUE),
interval = "mean_ci",
mid = "mean",
whiskers = c("mean_ci_lwr", "mean_ci_upr"),
table = c("n", "mean_sd", "median", "range"),
mid_type = "pl",
mid_point_size = c(2, 1, 5),
table_font_size = c(4, 2, 6),
plot_height = c(1000L, 200L, 4000L),
plot_width = NULL,
pre_output = NULL,
post_output = NULL,
ggplot2_args = teal.widgets::ggplot2_args()
)
Arguments
label |
( |
dataname |
( |
parentname |
( |
strata |
|
x |
( |
y |
( |
y_unit |
( |
paramcd |
( |
param |
( |
conf_level |
( |
interval |
( |
mid |
( |
whiskers |
( |
table |
( |
mid_type |
( |
mid_point_size |
( |
table_font_size |
( |
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)
library(forcats)
ADSL <- tmc_ex_adsl
ADLB <- tmc_ex_adlb %>% mutate(AVISIT == fct_reorder(AVISIT, AVISITN, min))
app <- init(
data = cdisc_data(
ADSL = ADSL,
ADLB = ADLB,
code = "
ADSL <- tmc_ex_adsl
ADLB <- tmc_ex_adlb %>% mutate(AVISIT == fct_reorder(AVISIT, AVISITN, min))
"
),
modules = modules(
tm_g_lineplot(
label = "Line Plot",
dataname = "ADLB",
strata = choices_selected(
variable_choices(ADSL, c("ARM", "ARMCD", "ACTARMCD")),
"ARM"
),
y = choices_selected(
variable_choices(ADLB, c("AVAL", "BASE", "CHG", "PCHG")),
"AVAL"
),
param = choices_selected(
value_choices(ADLB, "PARAMCD", "PARAM"),
"ALT"
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}