Skip to content

Commit 67570c1

Browse files
author
Oliver Drechsel
committed
added a "Download Filtered Data" button & its logisitics
1 parent b7e75c1 commit 67570c1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tool/server.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,16 @@ shinyServer(function(input, output, session) {
378378
write.csv(plot.settings, txtfile, row.names=FALSE)
379379
}
380380
)
381+
382+
# download the filtered data shown in the data table beneath the plot
383+
output$downloadFilteredData <- downloadHandler(
384+
filename = "filtered_data.tsv",
385+
content = function(file) {
386+
write.table(plot.raw.data(), file = file, sep='\t', row.names=FALSE, col.names=TRUE, quote = FALSE)
387+
}
388+
)
381389

390+
# download the raw input data
382391
output$downloadData <- downloadHandler(
383392
filename = "raw_data.tsv",
384393
content = function(file) {

tool/ui.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ shinyUI(fluidPage(
117117
# download the input data or unzipped/shaped data
118118
column(2,
119119
downloadButton('downloadData', 'Download Raw Data')
120-
),
120+
),
121+
# download filtered table
122+
column(2,
123+
downloadButton('downloadFilteredData', 'Download Filtered Data')
124+
),
121125

122126
# show a head of the new data set (influenced by "method")
123127
#tableOutput("view")

0 commit comments

Comments
 (0)