title: R save table as image
body: <p>I would like to export a data frame as a (png) image. I've tried with this code, but the table get clipped vertically.</p>
  
  <pre><code>library(ggplot2)
  library(gridExtra)
  
  df &lt;- data.frame(a=1:30, b=1:30)
  
  png("test.png")
  p&lt;-tableGrob(df)
  grid.arrange(p)
  dev.off()
  </code></pre>
  
  <p>Is there a way to avoid this behaviour without having to set manually the size of the image?</p>