Filter.Rd
The filter module provides an interface to select a data set, variable, and a query based on the value.
R6 class
datalist
A list of data sets. Can be tibbles, data frames, etc. Expects them to have a common ID field (default is USUBJID
)
options
The options for the module of type reactiveValues
with values
expanded
Should the accordion be expanded when created? Default: TRUE
subjectDs
If one of the data sets in datalist
contains subject level data then provide it here. Default: ADSL
idvar
ID field that is common across all datasets in input:datalist
. Default USUBJID
filter
S3 object DatasetFilter
Other tidymodules:
SubgroupManager
,
Subgroup
,
SubpopulationManager
,
Subpopulation
,
TTEMapping
,
TTE
,
TableListing
,
VariableSelection
tidymodules::TidyModule
-> Filter
Inherited methods
new()
Filter$new(...)
ui()
Filter$ui()
server()
Filter$server(input, output, session, data = NULL, options = NULL)
clone()
The objects of this class are cloneable with this method.
Filter$clone(deep = FALSE)
deep
Whether to make a deep clone.
if (FALSE) { library(tidymodules) library(subpat) library(bs4Dash) addFilter1 <- Filter$new() ui <- tagList( shinyjs::useShinyjs(), bs4DashPage( sidebar = bs4DashSidebar(disable = TRUE), body = bs4DashBody( bs4Accordion(id = 'filterAccordion', addFilter1$ui()), verbatimTextOutput('filter_results'), verbatimTextOutput('showPatients') ) ) ) # Define server logic server <- function(input, output) { datalist <- reactive({ example_datasets <- list( "ADSL" = data.frame( a = c("x", "z", "y", "x", "z", "x", "x", "y", "x", "y"), b = c(29L, 4L, 15L, 28L, 41L, 25L, 41L, 15L, 6L, 17L), USUBJID = as.character(seq_len(10)), stringsAsFactors = FALSE ), "ADAE" = data.frame( a = c("x", "z", "y", "x", "z", "x", "x", "y", "x", "y"), c = c(1, NA, NA, 1, 2, NA, NA, 4, 3, 1), dates = seq(as.Date("2019-07-10"), as.Date("2019-08-12"), length.out = 10), USUBJID = as.character(seq_len(10)), stringsAsFactors = FALSE ) ) }) opts <- reactiveValues( subjectDs = "ADSL", idvar = "USUBJID" ) addFilter1$callModule() observe({ # Add the options to the filter module opts %>2% addFilter1 # Add the data to the filter module datalist %>1% addFilter1 }) output$filter_results <- renderPrint({ filter_reactive <- addFilter1$getOutput("filter") str(filter_reactive()) }) } # Run the application shinyApp(ui = ui, server = server) }