I am making a Shiny app where there are different options to generate different plots. I want that the last option is that the user chooses if he wants to download any of these plots in pdf format. For it I have put a radioButton to choose which one wants and an actionButton to indicate that it initiates the action.
I do not know why the code does not work. Does anyone have an idea of how to solve it? Would it be better to do it with downloadHandler? My code is this:
# Save
observeEvent(input$save, {
if (input$save == "Phylogenetic tree"){
ggsave("Phylogenetic_tree.pdf", fileee(), height=13, width=16.5, limitsize = FALSE)
}
else if(input$save == "Enrooted phylogenetic tree"){
ggsave("Enrooted_phylo_tree.pdf", tree_root, height=13, width=16.5, limitsize = FALSE)
}
else if(input$save == "Rotated phylogenetic tree"){
ggsave("Rotated_phylo_tree.pdf", tree_rot, height=13, width=16.5, limitsize = FALSE)
}
else {
ggsave("Flipped_phylo_tree.pdf", tree_flip, height=13, width=16.5, limitsize = FALSE)
}
})