| pickerGroup-module {shinyWidgets} | R Documentation |
Group of mutually dependent ‘pickerInput' for filtering data.frame’s columns.
pickerGroupUI(id, params, label = NULL, btn_label = "Reset filters", options = list()) pickerGroupServer(input, output, session, data, vars)
id |
Module's id. |
params |
a named list of parameters passed to each 'pickerInput', you can use : 'inputId' (obligatory, must be variable name), 'label', 'placeholder'. |
label |
character, global label on top of all labels. |
btn_label |
reset button label. |
options |
See |
input |
standard |
output |
standard |
session |
standard |
data |
a |
vars |
character, columns to use to create filters,
must correspond to variables listed in |
a reactive function containing data filtered.
## Not run:
if (interactive()) {
library(shiny)
library(shinyWidgets)
data("mpg", package = "ggplot2")
ui <- fluidPage(
fluidRow(
column(
width = 10, offset = 1,
tags$h3("Filter data with picker group"),
panel(
pickerGroupUI(
id = "my-filters",
params = list(
manufacturer = list(inputId = "manufacturer", title = "Manufacturer:"),
model = list(inputId = "model", title = "Model:"),
trans = list(inputId = "trans", title = "Trans:"),
class = list(inputId = "class", title = "Class:")
)
), status = "primary"
),
dataTableOutput(outputId = "table")
)
)
)
server <- function(input, output, session) {
res_mod <- callModule(
module = pickerGroupServer,
id = "my-filters",
data = mpg,
vars = c("manufacturer", "model", "trans", "class")
)
output$table <- renderDataTable(res_mod())
}
shinyApp(ui, server)
}
## End(Not run)