Forum Discussion
Zooming in on RStudio (heat)maps
Anonymous,
I see. I can copy paste the syntax, which I already tried to use.
library("ggmap", lib.loc="~/R/win-library/3.2")
library("ggplot2", lib.loc="~/R/win-library/3.2")
Country.map = get_map(location = "Location", zoom = 8, color="bw") ## get MAP data
options(stringsAsFactors=T) ## need to run this --- weird ggplot bug=!
p <- ggmap(Country.map)
p <- p + stat_density_2d(bins=150, geom='polygon', size=2, data=dataset, aes(x = Longitude, y = Latitude, alpha=..level.., fill = ..level..))
p <- p + scale_fill_gradient(low = "yellow", high = "red", guide=FALSE) + scale_alpha(range = c(0.02, 0.8), guide = FALSE) +xlab("") + ylab("")
p + theme(axis.title=element_blank(),
axis.text=element_blank(),
axis.ticks=element_blank()) + ggtitle("Virksomheder")
This is only my starting point. It might very we be, that this syntax is entirely wrong for what I am trying to do. The data varies. Its just a lot of company data. So there are name, address, city, Mother company, long., lat., Ownership, in which business it operates in, and so on.
If you need anymore information please ask me :) Please keep in mind that the result below is "ok". But I do not seek a static solution. When I filter on one particular region, I would like it to only show that, and most importantly, To zoom in that particular region.
Screenshot of current result:
That's cool.
I didn't think the ggmap package was supported in PowerBI - see 'Supported Packages' at https://powerbi.microsoft.com/en-us/documentation/powerbi-service-r-visuals/
If you have Lat and Lon in your dataset, have you played around with bounding boxes (might still be classed as 'Experimental' with Google maps), calculating a zoom level to pass to oyur map request?
Alternately, can you limit the scale of your X and Y axis ?
- DatamindsMBM9 years agoFrequent Visitor
Oddly enough, if you go to https://powerbi.microsoft.com/en-us/documentation/powerbi-service-r-visuals/, and you search for ggmap, it doesn't show.
Anyhow, I haven't played around with bounding boxes. And I don't think that I can limit my X/Y axis, but I'm actually not sure.