The Data

The data this week comes from Microsoft by way of The Verge.

broadband <- read_csv("broadband.csv") %>%
  clean_names() %>%
  mutate(usage = as.numeric(broadband_usage),
         availability = as.numeric(broadband_availability_per_fcc))

Broadband

First let’s figure out how to put the broadband data onto a map of the US.1

p_broadband <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  ggplot(aes(x = long, y = lat, group = group, fill = usage)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Broadband Usage") +
  scale_fill_viridis_c()

p_broadband

In comparison to other things

Now that we’ve colored the map with the broadband data, let’s see how it compares to other variables (e.g., population or income available in the urbnmapr R package).

p_pop <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  ggplot(aes(x = long, y = lat, group = group, fill = hhpop)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Household population") +
  scale_fill_viridis_c()

p_home <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  ggplot(aes(x = long, y = lat, group = group, fill = horate)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Homeownership rate") +
  scale_fill_viridis_c()


p_income <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  ggplot(aes(x = long, y = lat, group = group, fill = medhhincome)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Median household income") +
  scale_fill_viridis_c()


p_broadband + p_pop + p_home + p_income + plot_layout(ncol = 2)

In California

It is kind of hard to see the trends across the US. So I thought I’d filter to California only.

p_broadband_CA <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  filter(state_name == "California") %>% 
  ggplot(aes(x = long, y = lat, group = group, fill = usage)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Broadband Usage") +
  scale_fill_viridis_c()

p_pop_CA <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  filter(state_name == "California") %>% 
  ggplot(aes(x = long, y = lat, group = group, fill = hhpop)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Household population") +
  scale_fill_viridis_c()

p_home_CA <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  filter(state_name == "California") %>% 
  ggplot(aes(x = long, y = lat, group = group, fill = horate)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Homeownership rate") +
  scale_fill_viridis_c()


p_income_CA <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  filter(state_name == "California") %>% 
  ggplot(aes(x = long, y = lat, group = group, fill = medhhincome)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Median household income") +
  scale_fill_viridis_c()


p_broadband_CA + p_pop_CA + p_home_CA + p_income_CA + plot_layout(ncol = 2)

In Oregon

And in Oregon…

p_broadband_OR <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  filter(state_name == "Oregon") %>% 
  ggplot(aes(x = long, y = lat, group = group, fill = usage)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Broadband Usage") +
  scale_fill_viridis_c()

p_pop_OR <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  filter(state_name == "Oregon") %>% 
  ggplot(aes(x = long, y = lat, group = group, fill = hhpop)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Household population") +
  scale_fill_viridis_c()

p_home_OR <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  filter(state_name == "Oregon") %>% 
  ggplot(aes(x = long, y = lat, group = group, fill = horate)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Homeownership rate") +
  scale_fill_viridis_c()


p_income_OR <- countydata %>%
  left_join(counties, by = "county_fips") %>%
  mutate(county_id = as.numeric(county_fips)) %>%
  left_join(broadband, by = "county_id") %>%
  filter(state_name == "Oregon") %>% 
  ggplot(aes(x = long, y = lat, group = group, fill = medhhincome)) +
  geom_polygon(color = NA) +
  coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
  labs(fill = "Median household income") +
  scale_fill_viridis_c()


p_broadband_OR + p_pop_OR + p_home_OR + p_income_OR + plot_layout(ncol = 2)

## [1] "You are priceless!"

  1. Code inspired by Data@Urban and their great package urbnmapr.↩︎