Description Usage Arguments Value Examples
View source: R/patternSelection_module.R
Select variables based on pattern (or a regular expression)
patternSelection module server function
1 2 3 | patternSelectionInput(id)
patternSelection(input, output, session, choices = reactiveValues())
|
id |
shiny id |
input |
shiny input |
output |
shiny output |
session |
shiny session |
choices |
reactivevalues object containing vectors of possible choices for each selection variable |
a reactivevalues object with:
: selected values
: selected variable
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ## Not run:
library(shiny)
if (interactive()){
ui <- fluidPage(
selectizeInput("selection",
label = "selected values",
choices = NULL, selected = NULL, multiple = TRUE),
patternSelectionInput("pattern_module")
)
server <- function(input, output, session) {
choices <- reactiveValues()
observe({
gs <- load_gs("./inst/ext/gs")
choices$sample <- pData(gs)$name
choices$subset <- gs_get_pop_paths(gs)
})
res <- callModule(patternSelection, "pattern_module", choices = choices)
observe({
if(!is.null(res$variable)){
updateSelectizeInput(session, "selection",
choices = choices[[res$variable]], selected = res$values)
}
})
}
shinyApp(ui, server)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.