Handling shapefiles to map Afghanistan health facilities
This recipe is wonderful because it's teaching so many things at once. The main goal is to teach you how to read and handle shapefiles. Additionally it also teaches how to download files directly from the console, how to create temporary files and directories, and reinforce the use of polygons and points to draw maps using ggplot2
.
A little disclaimer: this code is big. However, do not feel intimidated by it, there is much to learn from this recipe. Much of it is not restricted to maps, it can be generalized to the handling of web-available data. Relying on data available on the internet makes your codes more reproducible and less local-file dependent. Upload your data and code. Tet the community help out. Now let's plot Afghanistan districts and highlight health facilities.
Getting ready
Make sure to have an internet connection. This is a not only a requirement for the packages we may need to install but also to get that. That will be...