Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dataFilter

Shiny module for filtering data


Description

Shiny module for filtering data

Usage

dataFilterUI(id)

dataFilterServer(id, data = reactive(NULL), hide = FALSE)

Arguments

id

unique identifier for the module to prevent namespace clashes when making multiple calls to this shiny module.

data

an array wrapped in reactive() containing the data to be filtered.

hide

logical indicating whether the data sfiltering user interface should be hidden from the user, set to FALSE by default.

Value

a list of reactive objects containing the filtered data and indices for filtered rows.

Author(s)

Dillon Hammill, Dillon.Hammill@anu.edu.au

Examples

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)
}

DataEditR

An Interactive Editor for Viewing, Entering, Filtering & Editing Data

v0.1.1
GPL-2
Authors
Dillon Hammill [aut, cre] (<https://orcid.org/0000-0002-1407-7223>)
Initial release
2021-05-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.