filter_table | R Documentation |
Filter a dataframe using the output of a queryBuilder. The return_value
Should be set to r_rules
, and the list of filters should contain column names
that are present in the data as their id value.
filter_table(data = NULL, filters = NULL)
data |
|
filters |
output from queryBuilder when |
A filtered version of the input data.frame
library(shiny)
library(jqbr)
filters <- list(
list(
id = "cyl",
type = "integer",
input = "radio",
values = list(
4,
6,
8
)
)
)
ui <- fluidPage(
queryBuilderInput(
inputId = "r_filter",
filters = filters,
return_value = "r_rules"
),
tableOutput("cars")
)
server <- function(input, output) {
output$cars <- renderTable({
filter_table(mtcars, input$r_filter)
})
}
if (interactive()) {
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.