I have by-branch checkout data for all juvenile books for the entire Seattle Public Library system for the past 5 years (we can get past 10 if we ask for it). We also have data on which books each branch holds. There are 28 branches in the library system. The maps below show the 2010 census race data by census tract. The circles show branch locations.
LIBRARY_LOCATIONS <- "seattle_branch_locations.csv"
racevars <- c(White = "P005003",
Black = "P005004",
Asian = "P005006",
Hispanic = "P004003")
king_with_tract <- king %>%
mutate(tract = str_extract(NAME, "(\\d)+"),
tract = as.numeric(tract)) %>%
filter(tract < 120)
library_locations <- read_csv(LIBRARY_LOCATIONS)
library_df <- library_locations %>%
filter(!is.na(lon)) %>%
st_as_sf(coords = c("lon", "lat"), crs = 4629)
king_with_tract %>%
mutate(pct = 100 * (value / summary_value)) %>%
ggplot() +
facet_wrap(~variable) +
geom_sf(color = NA, aes(fill = pct)) +
geom_sf(data = library_df, shape = 1) +
coord_sf(crs = 26915) +
scale_fill_viridis_c(begin = 1, end = 0) +
theme_classic()