Skip to contents

The available datasets to choose from for each dataset selector is the same and determined by the argument variables.

Usage

tm_g_scatterplotmatrix(
  label = "Scatterplot Matrix",
  variables,
  plot_height = c(600, 200, 2000),
  plot_width = NULL,
  pre_output = NULL,
  post_output = NULL
)

Arguments

label

(character) Label shown in the navigation item for the module.

variables

(data_extract_spec or list of multiple data_extract_spec) Plotting variables from an incoming dataset with filtering and selecting. In case of data_extract_spec use select_spec(..., ordered = TRUE) if plot elements should be rendered according to selection order.

plot_height

optional, (numeric) A vector of length three with c(value, min and max) for a slider encoding the plot height.

plot_width

optional, (numeric) A vector of length three with c(value, min and max) for a slider encoding the plot width.

pre_output

(shiny.tag, optional)
with text placed before the output to put the output into context. For example a title.

post_output

(shiny.tag, optional) with text placed after the output to put the output into context. For example the shiny::helpText() elements are useful.

Note

For more examples, please see the vignette "Using scatterplot matrix" via vignette("using-scatterplot-matrix", package = "teal.modules.general").

Examples

# Scatterplot matrix of variables from ADSL dataset
library(scda)

ADSL <- synthetic_cdisc_data("latest")$adsl
ADRS <- synthetic_cdisc_data("latest")$adrs

app <- init(
  data = cdisc_data(
    cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
    cdisc_dataset("ADRS", ADRS, code = "ADRS <- synthetic_cdisc_data(\"latest\")$adrs"),
    check = TRUE
  ),
  modules = modules(
    tm_g_scatterplotmatrix(
      label = "Scatterplot matrix",
      variables = list(
        data_extract_spec(
          dataname = "ADSL",
          select = select_spec(
            label = "Select variables:",
            choices = variable_choices(ADSL),
            selected = c("AGE", "RACE", "SEX"),
            multiple = TRUE,
            ordered = TRUE,
            fixed = FALSE
          )
        ),
        data_extract_spec(
          dataname = "ADRS",
          filter = filter_spec(
            label = "Select endpoints:",
            vars = c("PARAMCD", "AVISIT"),
            choices = value_choices(ADRS, c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")),
            selected = "INVET - END OF INDUCTION",
            multiple = TRUE
          ),
          select = select_spec(
            label = "Select variables:",
            choices = variable_choices(ADRS),
            selected = c("AGE", "AVAL", "ADY"),
            multiple = TRUE,
            ordered = TRUE,
            fixed = FALSE
          )
        )
      )
    )
  )
)
#> [INFO] 2022-06-14 17:42:42.5447 pid:1110 token:[] teal.modules.general Initializing tm_g_scatterplotmatrix
if (FALSE) {
shinyApp(app$ui, app$server)
}