Showing results for 
Search instead for 
Did you mean: 

Problem with formattable package from r

Hi, i´m try to excecute this code in power bi desktop:



  formattable(mtcars, list(mpg = formatter("span",
                                           style = x ~ style(display = "block",
                                                             "border-radius" = "4px",
                                                             "padding-right" = "4px",
                                                             color = "white",
                                                             "background-color" = rgb(x/max(x), 0, 0))))

but, it comes with this problem



When i excecute the code in Rstudio, it works:




so, I searched in the packages soported in power bi to custom visual object and the library formattable is there. You can check by your self here:


so...I don´t understand, what happend...because the code is fine and the data was update like I used to do. Can you helpme?




Status: Needs Info
Super Contributor

Hi @sergiomora123 ,


What does the error message say? Please translate it into English.


Best regards,

Yuliana Gu

Super Contributor
Status changed to: Needs Info
Occasional Visitor



The visual object can not be displayed 

no image has been created. The R code has not generated any visual objects. Make sure that the R script results in a trace on the default R device.



Sergio M.

New Member

Good afternoon ,


We have this problem and it is essential to count on you to give a brief answer and solution. Can help us? @v-yulgu-msft 

                   Thank You.




Universidad Politecnico GranColombiano - Bogotá Colombia