Skip to contents

[Stable]

Display the AE by subgroups plot as a teal module

Usage

tm_g_ae_sub(
  label,
  dataname,
  arm_var,
  group_var,
  plot_height = c(600L, 200L, 2000L),
  plot_width = NULL,
  fontsize = c(5, 3, 7)
)

Arguments

label

(character(1))
menu item label of the module in the teal app.

dataname

(character(1))
analysis data used in the teal module, needs to be available in the list passed to the data argument of teal::init().

arm_var

(choices_selected)
object with all available choices and the pre-selected option for variable names that can be used as arm_var. See teal.transform::choices_selected() for details. Column arm_var in the dataname has to be a factor.

group_var

(choices_selected) subgroups variables. See teal.transform::choices_selected() for details.

plot_height

(numeric(3))
vector to indicate default value, minimum and maximum values.

plot_width

(numeric(3))
vector to indicate default value, minimum and maximum values.

fontsize

(numeric(1) or numeric(3))
Defines initial possible range of font-size. fontsize is set for teal.widgets::optionalSliderInputValMinMax() which controls font-size in the output plot.

Value

the teal::module() object.

Author

Liming Li (Lil128) liming.li@roche.com

Molly He (hey59) hey59@gene.com

Examples

# Example using stream (ADaM) dataset
ADSL <- osprey::rADSL
ADAE <- osprey::rADAE

app <- init(
  data = cdisc_data(
    cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
    cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE"),
    check = TRUE
  ),
  modules = modules(
    tm_g_ae_sub(
      label = "AE by Subgroup",
      dataname = "ADAE",
      arm_var = teal.transform::choices_selected(
        selected = "ACTARMCD",
        choices = c("ACTARM", "ACTARMCD")
      ),
      group_var = teal.transform::choices_selected(
        selected = c("SEX", "REGION1", "RACE"),
        choices = c("SEX", "REGION1", "RACE")
      ),
      plot_height = c(600, 200, 2000)
    )
  )
)
#> [INFO] 2023-08-14 13:53:43.4510 pid:1120 token:[] teal.osprey Initializing tm_g_ae_sub
if (interactive()) {
  shinyApp(app$ui, app$server)
}