I'm looking for some help creating heatmaps in R. I'm trying to achieve a result similar to this one:
I’ve Googled this many times but am unable to find a tutorial to give me this result. I seem to have a different definition of a heatmap ;-)
I’ll post a few code snippets below but so far I’ve been able to get a country map using ggmap, adding the long & lat to my data and I’ve been able to display this somewhat as desired, my only issue that remains is to actually show hotspot.
Right now I'm using ggplot2 & ggmap and i've made a dataframe named "df" containing a list of longitude & latitude coordinates (identical addresses are possible, which should be the "heat" part of my heatmap).
I grab the map of, in my case, Belgium as follows:
mapgilbert <- get_map(location = "Belgium", zoom = 7,maptype = "terrain", scale = 2)
next i try to plot my coordinates on there as such:
ggmap(mapgilbert) + geom_point(data = df, aes(x = lon, y = lat, fill = GeoIntake$Freq, colour = "red"), alpha = 0.1, size = 4, shape = 16) + guides(fill=FALSE, alpha=FALSE, size=FALSE)
Can anyone point me in the right direction? The starting point would be a dataframe with some lon/lat info in there, I can easily deduplicate this and add a "frequency" to it.