title: How to delete a chart using observeEvent in shiny?
body: <p>I am using the shiny runtime in flexdashboard.</p>
  
  <p>I would like to hide a chart on button press (<code>input$updt</code>), and I was trying this:</p>
  
  <pre><code>   ---
  title: "Students Data - College of Business"
  output: 
    flexdashboard::flex_dashboard:
        orientation: columns 
  
  runtime: shiny
  ---
  ```{r setup, include=FALSE}
  library(flexdashboard)
  library(ggplot2)
  library(shinyjs)
  shinyjs::useShinyjs(rmd=TRUE)
  ```
  
  Column {data-width=650}
  -----------------------------------------------------------------------
  
  ### Chart A
  
  ```{r}
  
  actionButton('updt', 'Update chart')
  output$p1 &lt;-renderPlot({ ggplot(diamonds, aes(carat, price)) + geom_point() }, height=800)
  plotOutput("p1")
  
  output$p2 &lt;- renderPlot({
     ggplot(mtcars, aes(cyl, disp))+ geom_point()
  })
  
  plotOutput("p2")
  observeEvent(input$updt, {hide("p1")})
  
  
  ```
  </code></pre>
  
  <p>However, when I click on the button it doesn't hide <code>p1</code></p>