This repository has two goals. One, it provides an example of the project directory structure that is discussed in Chapter 4 of Sociospatial Data Science. This is an extension of the project organization strategy discussed by Greg Wilson, Jenny Bryan, and colleagues in their excellent article Good enough practices in scientific computing.
Two, it provides working examples of a number of key skills for sociospatial data science:
- projecting tabular data that contains spatial references using
sf
- accessing spatial data via
tigris
- cleaning and geoprocessing spatial data with
dplyr
andsf
- exploring patterns in spatial data
ggplot2
andRColorBrewer
- creating interactive maps using
leaflet
Missouri is an interesting state for mapping earthquakes due to the presence of the New Madrid seismic zone in the southeast part of the state (known as the "bootheel"). The region was the site of a series of powerful earthquakes in 1811 and 1812 near New Madrid, MO. These earthquakes have been estimated to be the most powerful ones to occur east of the Rocky Mountains in recorded history. This area was also rated by the USGS in 2014 as having some of the highest earthquake hazard levels in the continental United States east of the Rocky Mountains:
There are four notebooks included in the doc
subdirectory. The intended progression through these notebooks is as follows:
CreateQuakes.Rmd
- initial creation of a shapefile containing earthquakes in MissouriExploreQuakes.Rmd
- exploratory data analysis and mapping of the earthquake dataCountyQuakes.Rmd
- additional mapping of earthquakes by countyLeafletQuakes.Rmd
- creation of an interactive maps of both the point and county earthquake data
The CRAN release of ggplot2
does not yet include the geom_sf()
geom for plotting simple features. This tutorial therefore requires the development version, which you can install from GitHub using the devtools
package.
The CreateQuakes.Rmd
notebook creates a shapefile of earthquakes in Missouri between 1973 and 2017 that were at least 2.0 on the Richter scale. These data can be previewed in this repository, and they are used for a completed map that is created in ExploreQuakes.Rmd
:
These data are also aggregated by county. The .geojson
output can be previewed in this repository, and they are used for a completed map that is created in CountyQuakes.Rmd
:
Since this is a part of my Introduction to GIS course and I teach at a university in St. Louis, we focus on Missouri. However, it would be relatively easy to replicate this set of exercises with data from another state. CreateQuakes.Rmd
contains a description of how the raw data were obtained. This process would need to be done again, with a custom geographic area defined around your state of interest. The tigris
functions in CreateQuakes.Rmd
and CountyQuakes.Rmd
would also have to be adjusted.