sideFilterUI | R Documentation |
Create an input component intended to function as a filter that can be turned on/off
sideFilterUI(
inputId,
values,
input = c("select", "selectize", "checkbox", "checkboxGroup", "range"),
selected = NULL,
conditional = NULL,
ns = NS(NULL),
width = 200
)
inputId |
The input slot that will be used to access the value. |
values |
Choices for the input. |
input |
One of input types |
selected |
The initial selection of the input, which defaults to "first" for the first of |
conditional |
If given a boolean value, will wrap element in a conditional panel with inital display given by the value,
with a switch element to control conditional display. Use |
ns |
Function for namespacing components, i.e. from 'session$ns'. |
width |
Width of input elements. |
This is a wrapper for creating certain Shiny input components to use as dataset filters,
e.g. each column of a table gets its own specified input component,
which is of a type enumerated in the parameter type
.
Generally, sliderInput
(range) is appropriate for numeric columns representing continuous data,
while selectInput
, selectizeInput
and checkboxInput
can be used for discrete data,
and checkboxGroupInput
can be used for list columns (especially if using data.table
).
Whether to initialize the input with none or all of the available values selected will depend on the data. For a very big table, it makes the most sense to initialize inputs with a selection of values that show the most relevant filtered subset rather than everything.
The inputs have namespaced IDs "<namespace>-filter-<colname>" by applying the passed-in
namespacing function ns
to id
. To get values in a server function, use filter4j
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.