-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
444 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#' downloadFilestab is a shiny widget which aims is to download a reactive plot | ||
#' | ||
#' @param id Shiny id | ||
#' @param label Shiny label | ||
#' | ||
#' @return Widget in the gui | ||
#' | ||
#' @export | ||
#' | ||
|
||
downloadFilestab <- function(id, label = "Save your Scree plot") { | ||
ns <- NS(id) | ||
downloadButton(ns("downloadtable"), label , style ="color: #fff; background-color: #337ab7; border-color: #2e6da4") | ||
} | ||
|
||
|
||
|
||
#' downoutputables is a shiny module which aims is to export reactive table | ||
#' | ||
#' @param input Internal | ||
#' @param output Internal | ||
#' @param session Internal | ||
#' @param projectname A reactive character (MA project or session data) | ||
#' @param suffix A character | ||
#' @param data A reactive expression to be plot | ||
#' @param cont A reactive character vector of the selected comparison(s) | ||
#' @param case A numeric value | ||
#' @param xlsx A boolean value | ||
#' | ||
#' @export | ||
#' | ||
|
||
downoutputables <- function(input, output, session , projectname, suffix = "plot.csv", data = NULL , cont = NULL, xlsx = F , case ) { | ||
|
||
|
||
|
||
output$downloadtable <- downloadHandler( | ||
|
||
filename <- function() { | ||
|
||
paste0(basename(file_path_sans_ext(projectname())), suffix , sep ='')}, | ||
|
||
|
||
content <- function(file) { | ||
|
||
if(!xlsx) | ||
write.table(try(switch(case, | ||
myventocsv(data() ,cont()), | ||
mysetventocsv(setvglobalvenn(data(), cont(), dll =T )), | ||
data())), | ||
file, | ||
na = "", | ||
row.names = F, | ||
col.names = T, | ||
append = TRUE, | ||
sep = ";" | ||
) | ||
else | ||
withProgress(message = 'Creation of the xlsx table:', | ||
value = 0, { | ||
n <- NROW(50) | ||
for (i in 1:n) { | ||
incProgress(1 / n, detail = "Please wait...") | ||
} | ||
|
||
|
||
library(xlsx) | ||
|
||
for (i in 1:length(data())) { | ||
if (i == 1) | ||
write.xlsx(file = file,data()[[i]], | ||
sheetName = paste("Cluster", i)) | ||
else | ||
write.xlsx( | ||
file = file, | ||
data()[[i]], | ||
sheetName = paste("Cluster", i), | ||
append = TRUE | ||
) | ||
} | ||
}) | ||
|
||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.