Skip to content

Instantly share code, notes, and snippets.

@brshallo
Created July 26, 2023 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brshallo/7a14235134f8e10139f71c3369f8d50f to your computer and use it in GitHub Desktop.
Save brshallo/7a14235134f8e10139f71c3369f8d50f to your computer and use it in GitHub Desktop.
Housing units added, new permits
library(tidyverse)
library(httr)
library(jsonlite)

# downloaded data from: https://data.seattle.gov/Permitting/Building-Permits/76t5-zqzr
data_permits <- read_csv("Building_Permits.csv")

data_permits %>% 
  filter(PermitTypeDesc == "New") %>% 
  filter(PermitClassMapped == "Residential",
         PermitClass == "Multifamily") %>% 
  mutate(applied_date_ceiling = lubridate::ceiling_date(AppliedDate, "quarters")) %>% 
  filter(AppliedDate < ymd(20230701), AppliedDate >= ymd(20180101)) %>% 
  group_by(applied_date_ceiling) %>% 
  summarise(new_units = sum(HousingUnitsAdded - HousingUnitsRemoved, na.rm = TRUE)) %>% 
  ggplot(aes(x = applied_date_ceiling, y = new_units))+
  geom_line()+
  ylim(0, NA)+
  theme_bw()+
  labs(
    x = "Applied Date (Quarter)",
    y = "New Residential Multifamily Units Added",
    title = "Seattle building permits issued or in progress"
  )

@brshallo
Copy link
Author

See related gist I made on permits issued: https://gist.github.com/brshallo/80401859d428a55967ce0d8bcfe16aee
(though used the .xlsx data source on SPD's website... and did not check closely that exactly mirrored approach as formats of files were different...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment