Hate Crimes

Robert W. Walker

November 18, 2019

For starters, you should try:

install.packages("plotly")

A FiveThirtyEight Example

What predicts hate crimes? Data from 538.

Visualizations

Start with an example map. Strip off the codes that determine the shapes on the map with select. Make sure that my data match one of the codes or recode them to do so. There are case change functions to make that easy, e.g. toupper and tolower.

Plotly

Plotly is fantastic. Here is a borrowed plotly example map modified to this purpose. The workflow involves taking the map example [agricultural exports] and using the dataset with abbreviations as the basis for merging in my own data on hate crimes. Then just change the variable names and the datasets and I have a working map.

A plot

Two Other Examples

I will show the same data with some different features of the rest of the data highlighted.

A Bubble Plot

An Interactive Bar Chart