Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi!
I have tried to do a R visual with "maps", "geosphere" and "leaflet" packages, to draw a line route beetween two points, but PowerBI doesn't show anything, I only get this message: "No image was created. The R code didn't result in creation of any visual. Make sure your R script results in a plot to the R default device".
The data is quite simple (is just an example):
Code from PowerBi's R scipt editor:
#Create dataframe
dataset <- data.frame(RUTA, ORIGEN, LAT1, LON1, DESTINO, LAT2, LON2)
#libraries
library(maps)
library(geosphere)
library(leaflet)
# geo-code
gcIntermediate(c(dataset[1,]$LON1, dataset[1,]$LAT1), c(dataset[1,]$LON2, dataset[1,]$LAT2),n=100,
addStartEnd=TRUE,
sp=TRUE) %>%
leaflet() %>%
addTiles() %>%
addPolylines()
In the other hand, if I run the script in R-Studio I get the map:
R code:
# Input load. Please do not change # `dataset` = read.csv('xxx.csv', check.names = FALSE, encoding = "UTF-8", blank.lines.skip = FALSE); library(maps) library(geosphere) library(leaflet) gcIntermediate(c(dataset[1,]$LON1, dataset[1,]$LAT1), c(dataset[1,]$LON2, dataset[1,]$LAT2),n=100, addStartEnd=TRUE, sp=TRUE) %>% leaflet() %>% addTiles() %>% addPolylines()
Thank you very much,
Luis
Solved! Go to Solution.
Hi @Anonymous
You may have a look at below articles to check if those are helpful or not.
https://community.powerbi.com/t5/Desktop/R-graphics-libraries-does-not-work-in-PBI/td-p/259473
https://medium.com/@dr_eldersveld/r-visuals-in-power-bi-beyond-plots-74c618f2e6f3
https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals
Regards,
Cherie
Hi @Anonymous
You may have a look at below articles to check if those are helpful or not.
https://community.powerbi.com/t5/Desktop/R-graphics-libraries-does-not-work-in-PBI/td-p/259473
https://medium.com/@dr_eldersveld/r-visuals-in-power-bi-beyond-plots-74c618f2e6f3
https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals
Regards,
Cherie
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |