Create a country map using R

I am looking for some help with creating heatmaps in R. I am trying to achieve a result similar to this:

enter image description here

Ive googled this many times but I cannot find a tutorial to give me this result. I seem to have a different definition of a heatmap :-)

Posted some code snippets below but so far I've managed to get a country map using ggmap adding long and lat to my data and I've been able to display this as desired, my only problem that remains is to actually show the hot point.

Right now I am using ggplot2 and ggmap and I have created a dataframe named "df" containing a list of coordinates and longitudes cooordinates (identical addresses are possible, which should be the "thermal" part of my heatmap).

I take a card, in my case, Beglium like this:

mapgilbert <- get_map(location = "Belgium", zoom = 7,maptype = "terrain", scale = 2)

      

Next I try to plot my coordinates 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 data frame with some lon / lat data, I can easily defuse that and add a "frequency" to it.

+3
r ggplot2 heatmap ggmap


source to share


No one has answered this question yet

See similar questions:

12
How to build a heat map on a spatial map
-1
Generating heatmaps with R, Php and Mongodb

or similar:

4
Create a continuous 1d map in R
3
Heatmap with values ​​in ggmap R
2
Draw Heatmap using ggmap?
1
Creating HeatMap in R with 2 variables
1
Is there a way to create a geomagmatic map geom_path in ggplot?
1
Create a heatmap based on values ​​in R
1
Heatmap with R, ggmap and ggplot
0
Smooth heatmap - how to create them?
0
Heatmap with value instead of count on ggmap (outline and geom_hex)
0
Using ggplot to plot a map from a matrix



All Articles
Loading...
X
Show
Funny
Dev
Pics