Create a scatterplot matrix
tm_g_scatterplotmatrix.RdThe 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(1)) Label shown in the navigation item for the module. Any label possible except"global_filters"- read more inmappingargument of teal_slices.- variables
(
data_extract_specorlistof multipledata_extract_spec) Plotting variables from an incoming dataset with filtering and selecting. In case ofdata_extract_specuseselect_spec(..., ordered = TRUE)if plot elements should be rendered according to selection order.- plot_height
optional, (
numeric) A vector of length three withc(value, min and max)for a slider encoding the plot height.- plot_width
optional, (
numeric) A vector of length three withc(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 theshiny::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
ADSL <- teal.modules.general::rADSL
ADRS <- teal.modules.general::rADRS
app <- teal::init(
data = teal.data::cdisc_data(
teal.data::cdisc_dataset("ADSL", ADSL, code = "ADSL <- teal.modules.general::rADSL"),
teal.data::cdisc_dataset("ADRS", ADRS, code = "ADRS <- teal.modules.general::rADRS"),
check = TRUE
),
modules = teal::modules(
teal.modules.general::tm_g_scatterplotmatrix(
label = "Scatterplot matrix",
variables = list(
teal.transform::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
)
),
teal.transform::data_extract_spec(
dataname = "ADRS",
filter = teal.transform::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] 2023-08-14 13:51:38.1412 pid:1296 token:[] teal.modules.general Initializing tm_g_scatterplotmatrix
if (interactive()) {
shinyApp(app$ui, app$server)
}