Data Importation and Modification
florida <- us_counties(states = "Florida")
states <- us_states()
# Data for the "difference data"
states_contiguous <- states %>%
filter(statefp != "72", statefp != "02", statefp != "15")
permits_m <- permits %>%
group_by(StateAbbr, year) %>%
filter(variable == "Single Family") %>%
summarise(countOfPermits = sum(value)) %>%
filter(year %in% c(2005:2010))
max_min_permits <- permits_m %>%
group_by(StateAbbr) %>%
summarise(difference4years = max(countOfPermits) - min(countOfPermits))
permit_difference <- max_min_permits %>%
left_join(states_contiguous, by = c("StateAbbr" = "stusps"))
permit_difference <- st_as_sf(permit_difference)
# United States Overview Data
## 2005
combined_contiguous_05 <- permits_m %>%
left_join(states_contiguous, by = c("StateAbbr" = "stusps")) %>%
filter(year == 2005)
combined_contiguous_05 <- st_as_sf(combined_contiguous_05)
## 2009
combined_contiguous_09 <- permits_m %>%
left_join(states_contiguous, by = c("StateAbbr" = "stusps")) %>%
filter(year == 2009)
combined_contiguous_09 <- st_as_sf(combined_contiguous_09)
# Flordia Graphic
## 2005 Florida
florida_permits_05 <- permits %>%
filter(StateAbbr == "FL",
variable == "Single Family",
year == 2005) %>%
rename(name = countyname) %>%
mutate(name = gsub(" County", "", name))
full_florida_05 <- florida_permits_05 %>%
left_join(florida)
full_florida_05 <- st_as_sf(full_florida_05)
## 2009 Florida
florida_permits_09 <- permits %>%
filter(StateAbbr == "FL",
variable == "Single Family",
year == 2009) %>%
rename(name = countyname) %>%
mutate(name = gsub(" County", "", name))
full_florida_09 <- florida_permits_09 %>%
left_join(florida)
full_florida_09 <- st_as_sf(full_florida_09)
New Permit Density Across The United States
2005
bins <- c(125, 4129, 8133, 15198.5, 22264, 30359, 38454, 123808, 209162)
pal <- colorBin("Greens", domain = combined_contiguous_05$countOfPermits, bins = bins)
leaflet(data = combined_contiguous_05) %>%
addTiles() %>%
addPolygons(color = "black",
data = states_contiguous,
fill = FALSE,
opacity = 1,
weight = 1) %>%
addPolygons(
fillColor = ~pal(countOfPermits),
weight = 2,
opacity = 1,
color = "black",
dashArray = "3",
fillOpacity = 1) %>%
addProviderTiles(providers$Esri.NatGeoWorldMap)
pander(summary(combined_contiguous_05$countOfPermits))
| 125 |
8133 |
22264 |
33073 |
38454 |
209162 |
2009
bins <- c(125, 4129, 8133, 15198.5, 22264, 30359, 38454, 123808, 209162)
pal <- colorBin("Greens", domain = combined_contiguous_05$countOfPermits, bins = bins)
leaflet(data = combined_contiguous_09) %>%
addTiles() %>%
addPolygons(color = "black",
data = states_contiguous,
fill = FALSE,
opacity = 1,
weight = 1) %>%
addPolygons(
fillColor = ~pal(countOfPermits),
weight = 2,
opacity = 1,
color = "black",
dashArray = "3",
fillOpacity = 1) %>%
addProviderTiles(providers$Esri.NatGeoWorldMap)
pander(summary(combined_contiguous_09$countOfPermits))
| 151 |
2704 |
6162 |
8653 |
10130 |
68230 |
Commentary: These two graphics show the density of new permits requested in each state in the year 2005 and 2009. As we can see, most states suffered dramatically during that transition. It would be interesting to know which states experienced the most dramatic difference within that period. The next graphic visualizes that question.
Which States Experience the Largest Decrease in Permits?
bins <- c(451, 2669.5, 4888, 9970.5, 15053, 21941.5, 28830, 105679.5, 182529)
pal <- colorBin("Greens", domain = permit_difference$difference4years, bins = bins)
leaflet(data = permit_difference) %>%
addTiles() %>%
addPolygons(color = "black",
data = states_contiguous,
fill = FALSE,
opacity = 1,
weight = 1) %>%
addPolygons(
fillColor = ~pal(difference4years),
weight = 2,
opacity = 1,
color = "black",
dashArray = "3",
fillOpacity = 1) %>%
addProviderTiles(providers$Esri.NatGeoWorldMap)
pander(summary(permit_difference$difference4years))
| 451 |
4888 |
15053 |
24743 |
28830 |
182529 |
Commentary: This graphic shows how much each state, in the US, decreased in the total number of new permits between 05’ and 09’. In this graphic, the darker the shade of green the greater the difference. Listed below the graphic is a six-point summary of the differences of the states. Florida was hit the worse (182529 decrease) and California was a close second (129178 decrease).
Changes in Permit Density in Florida
2005 New Single Family Permit Density In Each County
bins <- c(0, 86.75, 173.5, 656.85, 1418, 2269.9, 3121.8, 12666.4, 22211)
pal <- colorBin("Greens", domain = full_florida_05$value, bins = bins)
leaflet(data = full_florida_05) %>%
addTiles() %>%
addPolygons(
fillColor = ~pal(value),
weight = 2,
opacity = 1,
color = "black",
dashArray = "3",
fillOpacity = 1) %>%
addProviderTiles(providers$Esri.NatGeoWorldMap)
pander(summary(full_florida_05$value))
| 17 |
173.5 |
1418 |
3122 |
4632 |
22211 |
2009 New Single Family Permits Density In Each County
bins <- c(0, 86.75, 173.5, 656.85, 1418, 2269.9, 3121.8, 12666.4, 22211)
pal <- colorBin("Greens", domain = full_florida_09$value, bins = bins)
leaflet(data = full_florida_09) %>%
addTiles() %>%
addPolygons(
fillColor = ~pal(value),
weight = 2,
opacity = 1,
color = "black",
dashArray = "3",
fillOpacity = 1) %>%
addProviderTiles(providers$Esri.NatGeoWorldMap)
pander(summary(full_florida_09$value))
| 10 |
37 |
210 |
397.5 |
574.5 |
2470 |
Commentary: These two graphics demonstrate that there was a significant change in the number of permit requests in Florida. In this graphic, the darker the shade of green the more permit requests. Florida experienced the most dramatic drop in permit requests as we transitioned from 05’ to 09’.