From e6f091471d4bd357fbaa90a872883915f970abb5 Mon Sep 17 00:00:00 2001 From: Costa <47926492N@ICO.SCS.local> Date: Wed, 14 Jul 2021 10:41:28 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20funci=C3=B3n=20de=20exportar=20ob?= =?UTF-8?q?jeto=20del=20plot.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.R | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app.R b/app.R index 88edd49..5d77c30 100644 --- a/app.R +++ b/app.R @@ -131,7 +131,7 @@ server <- function(input, output) { t_maps<-generate_labstats(t_stats, t, "value", "variable", "Groups") dades$maps<<-t_maps } - if (length(unique(dades$taula[,"Groups"])) < 2){ + if (length(unique(dades$taula %>% pull(Groups))) < 2){ dades$stats<<-1 } @@ -211,6 +211,7 @@ server <- function(input, output) { output$expPlot <- renderPlot({ observeEvent(dades$final, {}) if (!is.null(dades$final)){ + print(dades$stats) t_substr<-dades$final t_stats<-dades$stats %>% filter(p.signif != "ns") t_maps<-dades$maps @@ -268,16 +269,19 @@ server <- function(input, output) { ) output$downloadPicture <- downloadHandler( filename = function() { - paste("Figura", ".png", sep="") + paste("Figura", ".zip", sep="") }, content = function(file){ print(file) # tempReport <- file.path(tempdir(), "elispots.Rmd") # file.copy("elispots.Rmd", tempReport, overwrite = TRUE) - png(file, width = input$width, height=input$height, units = "px", res=720) + png("plot.png", width = input$width, height=input$height, units = "px", res=720) plot(dades$plot) dev.off() - + save(dades$plot, list="plot", file="plot.RObject") + zip(file, + c("plot.png","plot.RObject") + ) } ) }