title: Update Plot output on ActionButton click event in R shiny
body: <p>I am trying to update text and plot both with <code>ActionButton</code> click.</p>
  
  <p>My Attempt- </p>
  
  <pre><code>library(shiny)
  library(ggplot2)
  library(shinyWidgets)
  
    ui &lt;- fluidPage(
      actionGroupButtons(
        inputIds = c("Bar", "Histogram", "Line"),
        labels = list("Bar", "Histogram","Line"),
        status = "danger",
        fullwidth = T
      ),
     plotOutput('plot',height = '563px'),
     verbatimTextOutput('text')
  
    )
  
    server &lt;- function(input, output) {
      output$plot &lt;- renderPlot({
  
        if(req(input$Bar)!=0) {
        isolate({
          data &lt;- iris
         ggplot(data, aes(Species,Petal.Length)) +
          geom_bar(stat="identity") 
        })
  
        } else if(req(input$Histogram)&gt;0){
          isolate({
            data &lt;-  iris
            ggplot(data, aes(Petal.Length)) +
              geom_histogram()
  
          })
  
        }  else if(req(input$Line)&gt;0){
          isolate({
            data &lt;-  iris
            ggplot(data, aes(Petal.Length,Sepal.Length)) +
              geom_line()
  
          })
        }
  
      })
  
  
      output$text &lt;- renderText({
  
        if(req(input$Bar)!=0) {
          "Bar"
  
        } else if(req(input$Histogram)&gt;0){
  
          "Histogram"
  
        }  else if(req(input$Line)&gt;0){
          "Line"
        }
  
      })
    }
  
    shinyApp(ui, server)
  </code></pre>
  
  <p>I want to change plot and text when the appropriate action button is clicked.</p>