Skip to contents

shinyfilters() creates a set of interdependent filters for use in a shiny application.

Usage

shinyfilters(
  .data,
  ...,
  area = FALSE,
  radio = FALSE,
  range = TRUE,
  selectize = TRUE,
  multiple = TRUE,
  slider = TRUE,
  textbox = FALSE,
  ns = NULL
)

Arguments

.data

A data.frame.

...

Named arguments passed to the selected input.

area

(character). Logical. Controls whether to use textAreaInput (TRUE) or textInput (FALSE). Only applies when textbox is TRUE.

radio

(character, factor, list, logical). Logical. Controls whether to use radioButtons (TRUE) or a dropdown input (FALSE). For character vectors, radio only applies if textbox is FALSE. TRUE turns off the selectize default; setting both to TRUE is an error.

range

(Date, POSIXt). Logical. Controls whether to use dateRangeInput (TRUE) or dateInput (FALSE).

selectize

(character, factor, list, logical). Logical. Controls whether to use selectizeInput (TRUE) or selectInput (FALSE). For character vectors, selectize only applies if textbox is FALSE.

multiple

Passed to selectInput or selectizeInput.

slider

(numeric). Logical. Controls whether to use sliderInput (TRUE) or numericInput (FALSE).

textbox

(character). Logical. Controls whether to use a text input (TRUE) or a dropdown input (FALSE).

ns

An optional namespace created by NS() or an object to be coerced to a namespace. Useful when using shinyfilters() inside a shiny module.

Value

A shinyfilters object.

Examples

if (FALSE) { # interactive()
shinyfilters(nyc_flights)

# Use sliders for every numeric column
shinyfilters(nyc_flights, slider = TRUE)
}