Today we discussed using the “maps” package and the “ggplot2” package to make simple maps in R.
Our test dataset is from the “rgbif” data package which makes use of publicly available data (see the “getting data” Topic). To deal with some of the georeferenced data we made use of the “dismo” package .
We made a basic map using ‘maps’:
And then took the same data and mapped it using ggplot2:
Because maps limits its field of view to the “states” basemap, whereas ggplot2 does not, we weren’t able to see this spurious detection way out in the middle of the ocean. Now that we see it, we used subset() to remove it and then made a fancy WSU themed cougar map using ggplot2:
The Script is here: simple-mapping