RMI / RMI/resources

Download the filtered data of a data table in shiny

Open
#292 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dashboard data
Dominant language
No language data
Stars
17
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Adapted from https://yihui.shinyapps.io/DT-info/

library(shiny)

ui <- fluidPage(
  DT::dataTableOutput("table"),
  downloadButton("download_filtered")
)

server <- function(input, output, session) {
  data <- head(datasets::BOD, 3)
  
  output$table <- DT::renderDataTable(data, server = FALSE)
  
  output$download_filtered <- downloadHandler(
    filename = "download-filtered.csv",
    content = function(file) {
      idx <- input$table_rows_all
      filtered <- data[idx, , drop = FALSE]
      readr::write_csv(filtered, file)
    }
  )
}

shinyApp(ui, server)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides an R Shiny example using DT::dataTableOutput, renderDataTable, and downloadHandler, but names no repository file or test. First locate the relevant data-table or download integration, then verify that a download contains only the rows remaining after filtering.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.