Skip to contents

Display Events by Term plot as a shiny module

Usage

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

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().

term_var

choices_selected object with all available choices and pre-selected option names that can be used to specify the term for events

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.

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.

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.

Value

the teal::module() object.

Author

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

Molly He (hey59) hey59@gene.com

Examples

library(scda)
library(nestcolor)

ADSL <- synthetic_cdisc_data("latest")$adsl
ADAE <- synthetic_cdisc_data("latest")$adae

app <- init(
  data = cdisc_data(
    cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
    cdisc_dataset("ADAE", ADAE, code = "ADAE <- synthetic_cdisc_data(\"latest\")$adae"),
    check = TRUE
  ),
  modules = modules(
    tm_g_events_term_id(
      label = "Common AE",
      dataname = "ADAE",
      term_var = choices_selected(
        selected = "AEDECOD",
        choices = c(
          "AEDECOD", "AETERM",
          "AEHLT", "AELLT", "AEBODSYS"
        )
      ),
      arm_var = choices_selected(
        selected = "ACTARMCD",
        choices = c("ACTARM", "ACTARMCD")
      ),
      plot_height = c(600, 200, 2000)
    )
  )
)
#> [INFO] 2022-10-19 12:23:41.1870 pid:1898 token:[] teal.osprey Initializing tm_g_events_term_id
if (FALSE) {
shinyApp(app$ui, app$server)
}