ggplot2 Choropleth of Supreme Court Decisions: A Tutorial
From the post:
I don't do much GIS but I like to. It's rather enjoyable and involves a tremendous skill set. Often you will find your self grabbing data sets from some site, scraping, data cleaning and reshaping, and graphing. On the ride home from work yesterday I heard an NPR talk about the Supreme Court decisions being very close with this court. This got me wondering if there is a data base with this information and the journey began. This tutorial is purely exploratory but you will learn to:
- Grab .zip files from a data base and read into R
- Clean data
- Reshape data with reshape2
- Merge data sets
- Plot a choropleth map in ggplot2
- Arrange several grid plots with gridExtra
I'm lazy and like a good challenge. I challenged myself to not manually open a file so I downloaded Biobase from bioconductor to open the pdf files for the codebook. Also I used my own package qdap because it had some functions I like and I'm used to using them. This blog post was created in the dev. version of the reports package using the wordpress_rmd template.
Good R practice and an interesting view of Supreme Court cases.