dataFilter | R Documentation |
Shiny module for filtering data
dataFilterUI(id) dataFilterServer(id, data = reactive(NULL), hide = FALSE, hover_text = NULL)
id |
unique identifier for the module to prevent namespace clashes when making multiple calls to this shiny module. |
data |
an array wrapped in |
hide |
logical indicating whether the data filtering user interface should be hidden from the user, set to FALSE by default. |
hover_text |
text to display on download button when user hovers cursor over button, set to NULL by default to turn off hover text. |
a list of reactive objects containing the filtered data
and
indices for filtered rows
.
Dillon Hammill, Dillon.Hammill@anu.edu.au
if (interactive()) { library(shiny) library(rhandsontable) library(shinyjs) ui <- fluidPage( useShinyjs(), dataInputUI("input1"), dataFilterUI("filter1"), rHandsontableOutput("data1") ) server <- function(input, output, session) { data_input <- dataInputServer("input1") # list with slots data and rows (indices) data_filter <- dataFilterServer("filter1", data = data_input ) output$data1 <- renderRHandsontable({ if (!is.null(data_filter$data())) { rhandsontable(data_filter$data()) } }) } shinyApp(ui, server) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.