Browse Source

Añadir función de exportar objeto del plot.

master
Costa 3 years ago
parent
commit
e6f091471d
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      app.R

+ 8
- 4
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")
)
}
)
}

Loading…
Cancel
Save