Data Table Viewer Teal Module
tm_data_table.RdA data table viewer shows the data using a paginated table.
Arguments
- label
(
character(1)) Label shown in the navigation item for the module.- variables_selected
(
list) A named list of character vectors of the variables (i.e. columns) which should be initially shown for each dataset. Names of list elements should correspond to the names of the datasets available in the app. If no entry is specified for a dataset, the first six variables from that dataset will initially be shown.- datasets_selected
(
character) A vector of datasets which should be shown and in what order. Names in the vector have to correspond with datasets names. If vector of length zero (default) then all datasets are shown.- dt_args
(named
list) Additional arguments to be passed toDT::datatable(must not includedataoroptions).- dt_options
(named
list) Theoptionsargument toDT::datatable. By defaultlist(searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), scrollX = TRUE)- server_rendering
(
logical) should the data table be rendered server side (seeserverargument ofDT::renderDataTable())- 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.
Details
The DT package has an option DT.TOJSON_ARGS to show Inf and NA in data tables. If this is something
you require then set options(DT.TOJSON_ARGS = list(na = "string")) before running the module.
Note though that sorting of numeric columns with NA/Inf will be lexicographic not numerical.
Examples
library(scda)
ADSL <- synthetic_cdisc_data("latest")$adsl
app <- init(
data = cdisc_data(
cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
check = TRUE
),
modules = modules(
tm_data_table(
variables_selected = list(ADSL = c("STUDYID", "USUBJID", "SUBJID", "SITEID", "AGE", "SEX")),
dt_args = list(caption = "ADSL Table Caption")
)
)
)
#> [INFO] 2022-10-14 01:38:19.5894 pid:2564 token:[] teal.modules.general Initializing tm_data_table
if (FALSE) {
shinyApp(app$ui, app$server)
}