Shiny allow users to choose which plot outputs to display
问题 I have a shiny app and my server function looks like this: shinyServer(function(input, output, session) { filedata <- reactive({ infile <- input$file1 if (is.null(infile)) { return(NULL) } myDF <- fread(infile$datapath) return(myDF) # Return the requested graph graphInput <- reactive({ switch(input$graph, "Plot1" = plot1, "Plot2" = plot2) }) output$selected_graph <- renderPlot({ paste(input$graph) }) output$plot1 <- renderPlot({ #fill in code to create a plot1 }) output$plot2 <- renderPlot({