Today Tung Nguyen presented some advanced mapping techniques. Today’s presentation used the following packages and a function from Stackoverflow (http://stackoverflow.com/questions/12156475/combine-voronoi-polygons-and-maps). He also used the attached shapefiles: r_base_shapefile
Tung showed us how he created polygons for individual catchments basins and then apply those polygons to a google maps basemap. In addition, we used ggplot2 to create differently sized symbols representing mean catchment size.
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: