diff --git a/2019-11-20-rural.R b/2019-11-20-rural.R new file mode 100644 index 0000000..1d0aaf0 --- /dev/null +++ b/2019-11-20-rural.R @@ -0,0 +1,33 @@ +library(sf) +library(readxl) +library(tigris) +library(albersusa) +library(hrbrthemes) +library(tidyverse) + +farms <- read_excel(here::here("data/Ag_Census_Map_data_07172015.xlsx"), sheet = "Farms", col_names = TRUE) + +ffactor <- c("Less than 250", "250 - 499", "750 - 999", "500 - 749", "1,000 or more") + +counties_sf() %>% + mutate(fips = as.character(fips)) %>% + left_join( + select(farms, fips = FIPSTEXT, range = y12_M249_classRange), + by = "fips" + ) %>% + mutate(range = factor(range, ffactor)) -> farms_df + +ggplot() + + geom_sf(data = farms_df, aes(fill = range), color = "#b2b2b2", size = 0.1) + + scale_fill_brewer( + name = "# Farms", palette = "Greens", na.value = "white", labels = ffactor, breaks = ffactor + ) + + coord_sf(crs = albersusa::us_laea_proj, datum = NA) + + labs( + x = NULL, y = NULL, + title = "Down On The Farm: County-level Census of Agriculture Farms-per-County", + subtitle = "While the USDA does track some 'urban farms' most of the farmland is, indeed, rural.", + caption = "Data: USDA ; {tigris}\nhttps://git.rud.is/hrbrmstr/y2019-30daymapchallenge • #30DayMapChallenge" + ) + + theme_ipsum_es(grid="") + + theme(legend.position = c(0.985, 0.5)) diff --git a/data/Ag_Census_Map_data_07172015.xlsx b/data/Ag_Census_Map_data_07172015.xlsx new file mode 100644 index 0000000..3847342 Binary files /dev/null and b/data/Ag_Census_Map_data_07172015.xlsx differ