Why look at construction year?

This plot shows the percent of homes built in Florida built before 1990.1990 is a significant turning point in home construction since any homes built after 1992 conformed to new regulations in hurricane safety following the destruction of Hurricane Andrew. In theory this plot would then provide a snapshot as to which counties in Florida might be more susceptible to hurricane damage.

Getting the data

housing_data <- get_acs(
  geography = "county",
  variables = c(
    total_housing = "B25001_001", 
    built_1980s = "B25034_009",   
    built_1970s = "B25034_008",   
    built_1960s = "B25034_007",    
    built_1950s = "B25034_006",   
    built_1940s_or_earlier = "B25034_005" 
  ),
  state = "FL",
  year = 2022,
  survey = "acs5",
  geometry = TRUE
)

Computing the data

housing_data_percent <- housing_data %>%
  select(GEOID, NAME, variable, estimate) %>%
  pivot_wider(names_from = variable, values_from = estimate) %>%
  mutate(
    total_pre_1990 = built_1980s + built_1970s + built_1960s + built_1950s + built_1940s_or_earlier,
    percent_pre_1990 = (total_pre_1990 / total_housing) * 100
  ) 

Creating the map

ggplot(housing_data_percent) +
  geom_sf(aes(fill = percent_pre_1990), color = "white") +
  scale_fill_viridis_c(option = "magma", name = "Percent of Homes Built Pre-1990")

Source: ACS-5 2017-2022