create_filter.Rd
This function generates a UI component for creating a filter in a Shiny application. The filter allows users to select a column, condition, and value to filter a dataset.
create_filter(filter_id, dataset)
A Shiny UI component for creating a filter.
The function creates a UI component with the following elements:
A horizontal rule (<hr>
).
A dropdown menu for selecting a column from the dataset.
A dropdown menu for selecting a condition (e.g., ==
, >
, <
, >=
, <=
).
A text input for specifying the filter value.
A submit button to confirm the filter.
A remove button to remove the filter.
if (FALSE) { # \dontrun{
# Example usage in a Shiny app:
ui <- fluidPage(
create_filter("filter1", mtcars)
)
server <- function(input, output, session) {}
shinyApp(ui, server)
} # }