diff --git a/invivos/app.R b/invivos/app.R index da71471..d2bb86e 100644 --- a/invivos/app.R +++ b/invivos/app.R @@ -645,7 +645,7 @@ server <- function(input, output) { content = function(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("invivo.png", width = input$width, height=input$height, units = "px", res=720) if (input$fig_id == "Survival"){ if (input$vacc == "Sí"){ arrange_ggsurvplots(dades$plot, nrow=2, ncol=1) @@ -654,8 +654,19 @@ server <- function(input, output) { } }else{plot(dades$plot)} dev.off() - + if (input$fig_id == "Survival"){ + if (input$vacc == "Sí"){ + invivo.plot<-arrange_ggsurvplots(dades$plot, nrow=2, ncol=1) + }else{ + invivo.plot<-arrange_ggsurvplots(list(dades$plot), ncol=1) + } + }else{invivo.plot<-dades$plot} + save(invivo.plot, file="invivoplot.RObject") + zip(file, + c("invivo.png", "invivoplot.RObject") + ) }) + }