Reading in the data & filtering
Filtering and organizing
permits %>%
arrange(desc(`Expected Construction Cost`)) %>% # Looking at the most expensive type Permit Type for this dataset, we see that is it RZ
head(5)
## # A tibble: 5 × 12
## `Permit Category` `County Agency` `Permit Case ID` `Permit Case Year`
## <chr> <chr> <dbl> <dbl>
## 1 Building Permit DPIE 3137172 2021
## 2 Building Permit DPIE 3128016 2021
## 3 Building Permit DPIE 3082137 2020
## 4 Building Permit DPIE 3122165 2020
## 5 Building Permit DPIE 3112960 2020
## # ℹ 8 more variables: `Permit Type` <chr>, `Case Name` <chr>,
## # `Street Address` <chr>, City <chr>, `Zip Code` <dbl>,
## # `Permit Issuance Date` <chr>, `Expected Construction Cost` <dbl>,
## # Location <chr>
rzpermits_summary <- permits %>%
filter(`Permit Type` == "RZ") %>% # Filtering for RZ permits only
group_by(`Permit Case Year`) %>% # Grouping RZ permits by year
summarise(Total_Cost = sum(`Expected Construction Cost`, na.rm = TRUE)) # Adding the sum of all RZ permits per year
Visualization
ggplot(rzpermits_summary, aes(x = `Permit Case Year`, y = Total_Cost)) +
geom_col(fill = "green") +
theme_minimal() +
labs(title = "Total Estimated Construction Cost of RZ Permits by Year",
x = "Permit Case Year",
y = "Expected Construction Cost") +
geom_text(aes(label = paste0("(", `Permit Case Year`, ") ", scales::comma(round(Total_Cost)))),
vjust = -0.5, size = 2.5)

WOW, look at 2021!