Forum Discussion
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!
Not an R expert by any means, but the only way I'm aware of using Plotly in Power Bi is via the custom visual. I successfully followed the instructions from the radacad blog linked below a while back. Its a much more involved process than the regular R visual, but the results are there. It does require installation of node.js as well.
http://radacad.com/interactive-map-using-r-and-power-bi-create-custom-visual-part-1
8 Replies
- CanadaMGBFrequent Visitor
Not an R expert by any means, but the only way I'm aware of using Plotly in Power Bi is via the custom visual. I successfully followed the instructions from the radacad blog linked below a while back. Its a much more involved process than the regular R visual, but the results are there. It does require installation of node.js as well.
http://radacad.com/interactive-map-using-r-and-power-bi-create-custom-visual-part-1
- AnonymousNot 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
Community 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:
- v-caliao-msft
Microsoft Employee
Anonymous,
>>"Can't display this visual. Make sure your R script results in a plot to the R default device."
For this issue, please check if the information on the link below helps or not.
http://community.powerbi.com/t5/Issues/R-visuals-with-the-DiagrammeR-package-don-t-work-in-Power-BI/idi-p/174131Regards,
Charlie Liao
- AnonymousNot applicable
That thread doesn't really answer my question. But thanks anyways.