title: How to clear all charts from viewer pane in RSTUDIO
body: <p>I have the following code which generates 5 plots in Rstudio Viewer Pane</p>
  
  <pre><code>library(highcharter)
  library(tidyverse)
  
  for(i in 1:5){
  
    highchart() %&gt;% 
      hc_add_series(mpg, "point", hcaes(x = displ, y = cty)) %&gt;%
      print()
  
  }
  </code></pre>
  
  <p>How can i delete them with code instead on doing it manually?
  searching the forum i tried the following:</p>
  
  <pre><code>graphics.off()
  dev.off()
  while (dev.cur()&gt;1) dev.off()
  if(!is.null(dev.list())) dev.off()
  </code></pre>
  
  <p>But none of the above helps me get rid of the plots
  i use Rstudio 1.1.423 and R 3.4.3</p>
  
  <p>Thanks
  Rafael</p>