Download the filtered data of a data table in shiny
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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