ordered_levels <- c("≥ +50%", "+10% to +49%", "-9% to +9%", "-49% to -10%", "≥ -50%", "New activity")
palette_colors <- c(
"≥ +50%" = "#1a9850", # dark green
"+10% to +49%" = "#a6dba0", # light green
"-9% to +9%" = "#f7f7f7", # beige
"-49% to -10%" = "#ef8a62", # light red
"≥ -50%" = "#b2182b", # dark red
"New activity" = "#4575b4" # blue
)
pal <- colorFactor(
palette = palette_colors,
levels = ordered_levels,
na.color = "transparent"
)
pal_novmar <- colorFactor(
palette = palette_colors,
levels = ordered_levels,
na.color = "transparent"
)
The map below plots the percent change in boardings on LA Metro buses between mid November and early January, relative to the January baseline. Red indicates a significant decline in boardings during the wildfires. Green indicates a significant increase. In some cases, block groups went from zero boardings in November to a non-zero number in January, these are in their own category “new activity” in blue, since a percent change off zero is infinite.
The map reveals dramatic drops in boardings in Altadena, reflecting cancelled service and evacuations. However, boardings increased in two block groups in the neighborhood. Boardings also declined heavily in areas impacted by the Palisades fire. Multivariate modelling is needed to estimate the localized ridership effects of air pollution, cancelled school, fare-free transit, and the opening of shelters.
# Map 1: Jan vs Nov
leaflet(cbg_geo) %>%
addProviderTiles("CartoDB.Positron") %>%
addPolygons(
fillColor = ~ifelse(novjanboards_cat == "No activity", NA, pal(novjanboards_cat)),
fillOpacity = ~ifelse(novjanboards_cat == "No activity", 0, 0.7),
color = "#333333", weight = 0.2, opacity = 0.4,
label = ~paste0("GEOID: ", GEOID, "<br>Change: ", novjanboards_cat),
highlightOptions = highlightOptions(weight = 2, color = "black", bringToFront = TRUE)
) %>%
addLegend("bottomright", pal = pal, values = ~novjanboards_cat,
title = "Jan → Nov % Change", opacity = 1)
## Warning: sf layer has inconsistent datum (+proj=longlat +datum=NAD83 +no_defs).
## Need '+proj=longlat +datum=WGS84'