---
title: "Homework 7 - Geoplotting US Wage Data"
output:
  pdf_document:
    latex_engine: xelatex
---

In this homework, we plot the mean wages over the US states. Start by creating a new RMarkdown document named `hw7-wages.Rmd` using the standard homework format.

The purpose of this analysis is to visualize the average wages for the different US states.

```{r echo=TRUE, message=FALSE, warning=FALSE}
library(tidyverse)       
library(readxl)
library(tigris)
```

##  Data

The data for this homework come from two sources.

1. The `tigris` dataset provides the state geographies.

```{r warning=FALSE, messages=FALSE, error=FALSE, results="hide"}
us_state_geographies <- tigris::states() %>% 
  shift_geometry()
```

Nb. The shift_geometry() function re-plots the non-continental US states closer to the rest. This creates a more compact geographic plot, but it may not work properly on some RStudio platforms. If it generates errors, feel free to drop that call from this code chunk.

2. This spreadsheet provides the mean wages by state. You&rsquo;ll need to cleanse this data.

```{r warning=FALSE, messages=FALSE, error=FALSE, results="hide"}
state_mean_wages_raw <- 
  read_excel("data/BLS-wages-by-state.xlsx",
             col_types = c("text", "numeric"), 
             skip = 4)
```

You&rsquo;ll combine these datasets to produce geospatially-categorized wage data, and focus only on the rows for the 50 states.

## Analysis

Produce a choropleth visualization that shows the average annual wages for all 50 states.

## Conclusion

Do you notice any interesting patterns in this data?
