title: Print an R dataframe with format in databricks
body: <p>I have the following code in R:</p>
  
  <p>(taken from <a href="https://cran.r-project.org/web/packages/formattable/vignettes/formattable-data-frame.html" rel="nofollow noreferrer">https://cran.r-project.org/web/packages/formattable/vignettes/formattable-data-frame.html</a>)</p>
  
  <pre><code>library(formattable)
  
  sign_formatter &lt;- formatter("span", 
                          style = x ~ style(color = ifelse(x &gt; 0, "green", 
                                                           ifelse(x &lt; 0, "red", "black"))) )
  
  products &lt;- data.frame(id = 1:5, 
                     price = c(10, 15, 12, 8, 9),
                     rating = c(5, 4, 4, 3, 4),
                     market_share = percent(c(0.1, 0.12, 0.05, 0.03, 0.14)),
                     revenue = accounting(c(55000, 36400, 12000, -25000, 98100), digits = 0L),
                     profit = accounting(c(25300, 11500, -8200, -46000, 65000)))
  
  
  
  formattable(products, list(
    price = color_tile("transparent", "lightpink"),
    rating = color_bar("lightgreen"),
    market_share = color_bar("lightblue"),
    revenue = sign_formatter,
    profit = sign_formatter) )
  </code></pre>
  
  <p>That prints the following table</p>
  
  <p><a href="https://i.stack.imgur.com/LGXVU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LGXVU.png" alt="enter image description here"></a></p>
  
  <p>How can I replicate this in databricks, or something similar</p>