Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

R graphics libraries does not work in PBI?

Hi everybody,

 

 

I'm trying to bring my graphics from RStudio to PBI but it's giving me this error: "Can't display this visual. Make sure your R scripts results in a plot to the R default device"

 

I tried using dygraph and plotly , but they give me the same error. Does anyone know which R library I can use in PBI to make my graphics prettier and interactive, like this one: https://moderndata.plot.ly/interactive-r-visualizations-with-d3-ggplot2-rstudio/

 

 

Thank you!

8 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi CanadaMGB,

       

      thank you so much for this material, this seems a great 'workaround' for my problem. Guess I'm gonna have to create a custom visual whenever I want to plot interactive R graphs. :D

       

      Hopefully, PBID team will make the R chart option suport more R libraries in the future.

       

       

      Best,

      I.A.

      • otravers's avatar
        otravers
        Icon for Community Champion rankCommunity Champion

        I'm posting in this old thread for the benefit of people googling for this stuff (or in Microsoft's fantasy universe, "binging").

         

        The Power BI documentation sounds a bit arcane if you're not versed in R. When they talk about the "R default display device", what they mean is that "regular" R charts will only work with R packages that generate an image (typically PNG). As you found out, it's only by creating a custom R chart that you can work with R packages that generate HTML, which is how the interactive ones work (e.g. Leaflet).

         

        This can be confusing when the same code that works in Rstudio fails in Power BI. But PBI does give you a clue in its error message, telling you that "No image was created. The R code didn't result in creation of any visuals".

         

        For reference, see known limitations here:

        https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals

    • Anonymous's avatar
      Anonymous
      Not applicable

      That thread doesn't really answer my question. But thanks anyways.