title: How to save Leaflet in R map as png or jpg file?
body: <p>I'm using Leaflet package to create maps in R. It works perfectly. I can export maps in R with simply Export, but I need to export maps from script in R. My simple code is:</p>
  
  <pre><code>png("test_png.png")
  (m &lt;- leaflet() %&gt;% addTiles())
  dev.off()
  </code></pre>
  
  <p>It works but... the output png file is white blank.</p>