[GIS] How to overlay point co-ordinates on tmap shapefile

ggmapr

So far, I've managed to visually present data for different socio-economic factors at a district level in Pakistan with the help of the tmap package in RStudio to create the following output.

Electricity in Schools

At the same time, I have used the ggmap package to plot the geographic co-ordinates of various towers for different Mobile Network Operators in Pakistan (roughly 13000 towers). The output is as follows.

Towers in Pakistan

My next requirement is to overlay the second plot over the first, essentially showing the towers on top of the district wise electricity scores.

Any ideas on which packages I could use (as well as sample code) in order to achieve this?

Best Answer

This can also be done with tmap. Have a look at the tmap vignette, especially the Plotting with tmap elements section.

In your case your code ought to look basically like this:

tm_shape(shapefile_with_electricity_data) + 
  tm_fill("Electricity_in_Schools_variable") + 
tm_shape(shapefile_with_MNO_data) + 
  tm_dots("MNO_variable")
Related Question