I made maps that look at the concentrations of types of land across the country. I wanted to show where certain land was most prevalent using the variables 1) defense land (training areas, bases, airports, etc) 2)forests 3)crop land and 4) forests.

In order to do this, I pulled data from USDA’s Economic Research Service, and tinkered with the data until I had pulled the right kind by state. All years are 2007, which was the most recent common year. I used a similar procedure for each set

read in the CSV

select the states map from maptools

lower the state names in my data to match the states map

These are the packages I used

library(ggplot2)
library(ggthemes)
library(maptools)
## Loading required package: sp
## Checking rgeos availability: TRUE

Next was plotting the map using ggplot. First is the data, then is the aesthetic

map_id selects what part of the data will be used to join the map to the data (as in, “states”)

geom_map is the actual filling of the data into the map. Expanding limits allows ggplot to understand where things are plotted.

Then I added a title and tinkered with theme elements. I chose the ggtheme fivethirtyeight for all of my maps

last I adjusted the color gradient and scale using the function scale_fill_gradient2

I essentially repeated the process for the different data sets I used to make the four different maps.

defense_2007 <- read.csv("defense_2007.csv")
states_map <- map_data("state")
defense_2007$State <- tolower(defense_2007$State)

ggplot(defense_2007, aes(map_id = State)) +
  geom_map(aes(fill = Defense), map = (states_map)) +
  expand_limits(x = states_map$long, y = states_map$lat) +
  ggtitle("Concentration of Defense Land 
          (Thousands of Acres)") +
  theme_fivethirtyeight() +
  theme(axis.text.y = element_blank(), axis.text.x = element_blank()) +
  scale_fill_gradient2(low = "white", 
                       high = "darkmagenta", limits = c(0, 5000))

crop2007 <- read.csv("Cropland2007.csv", header= TRUE)
states_map <- map_data("state")
crop2007$State <- tolower(crop2007$State)

ggplot(crop2007, aes(map_id = State)) +
  geom_map(aes(fill = Cropland), map = (states_map)) +
  expand_limits(x = states_map$long, y = states_map$lat) +
  ggtitle("Land Used for Crops
          (Thousands of Acres)") +
  theme_fivethirtyeight()+ 
  theme(axis.text.y = element_blank(), axis.text.x = element_blank()) +
  scale_fill_gradient2(low = "gray", 
                       high = "darkolivegreen3", limits = c(500, 30000)) 

swamps<- read.csv("swamps_by_state (1).csv") 
states_map <- map_data("state")
swamps$State <- tolower(swamps$State)

ggplot(swamps, aes(map_id = State)) +
  geom_map(aes(fill = Swamps), map = (states_map)) +
  expand_limits(x = states_map$long, y = states_map$lat) +
  ggtitle("Misc. Open Land--Swamps, deserts, etc
          (Thousands of Acres)") +
  theme_fivethirtyeight()+ 
  theme(axis.text.y = element_blank(), axis.text.x = element_blank()) +
  scale_fill_gradient2(low = "gray", 
                       high = "saddlebrown", limits = c(0, 5500))

forests<- read.csv("Forests - Sheet1.csv", header = TRUE) 
states_map <- map_data("state")
forests$State <- tolower(forests$State)

ggplot(forests, aes(map_id = State)) +
  geom_map(aes(fill = Forests), map = (states_map)) +
  expand_limits(x = states_map$long, y = states_map$lat) +
  ggtitle("Concentration of Forests By State
          (Thousands of Acres)") +
  theme_fivethirtyeight()+ 
  theme(axis.text.y = element_blank(), axis.text.x = element_blank()) +
  scale_fill_gradient2(low = "gray", 
                       high = "forestgreen", limits = c(0, 30000))

These maps show the states with concentrated areas of different land uses. I was surprised by defense, but the rest seemed pretty normal to me.