title: Command for exporting/saving table made with Formattable package in R
body: <p><a href="https://cran.r-project.org/web/packages/formattable/formattable.pdf" rel="noreferrer">https://cran.r-project.org/web/packages/formattable/formattable.pdf</a></p>
  
  <p>I've been using the Formattable package to make some nice looking tables in R. I'm trying to save the tables as images (or really any file format) but can't find a command that works. Using the jpeg/png function or dev.copy creates blank documents. Ideally I'd like to be able to save these tables in a loop. Does anyone know how this might be done?</p>
  
  <p>data: </p>
  
  <pre><code>library(formattable)
  DF &lt;- data.frame(Ticker=c("", "", "", "IBM", "AAPL", "MSFT"),
                   Name=c("Dow Jones", "S&amp;P 500", "Technology", 
                          "IBM", "Apple", "Microsoft"),
                   Value=accounting(c(15988.08, 1880.33, NA, 
                                      130.00, 97.05, 50.99)),
                   Change=percent(c(-0.0239, -0.0216, 0.021, 
                                    -0.0219, -0.0248, -0.0399)))
  
  formattable(DF, list(
    Name=formatter(
      "span",
      style = x ~ ifelse(x == "Technology", 
                         style(font.weight = "bold"), NA)),
    Value = color_tile("white", "orange"),
    Change = formatter(
      "span",
      style = x ~ style(color = ifelse(x &lt; 0 , "red", "green")),
      x ~ icontext(ifelse(x &lt; 0, "arrow-down", "arrow-up"), x)))
  )
  </code></pre>