Many municipalities implementing smart-growth principles do so by designated specific areas—sometimes called clusters with more flexible zoning. Usually, the intent is to obtain a mix of uses in a more walkable environment. Sometimes, these clusters get their own special zoning area or “planned unit development” in the zoning map. Sometimes, they are conceived as overlay districts: special areas that cross over two or more zoning districts, but in which regulated exceptions from the basic zoning guidelines are allowed. In such clusters or flexible development areas, towns usually provide incentives for developers to build at higher densities.
##
## Attaching package: 'janitor'
## The following objects are masked from 'package:stats':
##
## chisq.test, fisher.test
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.3.6 ✔ purrr 0.3.4
## ✔ tibble 3.1.7 ✔ dplyr 1.0.9
## ✔ tidyr 1.2.0 ✔ stringr 1.4.0
## ✔ readr 2.1.2 ✔ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
##
## Attaching package: 'scales'
##
##
## The following object is masked from 'package:purrr':
##
## discard
##
##
## The following object is masked from 'package:readr':
##
## col_factor
Create a new table of data from the “MASSZONG.xls”
masszoning <- read_xls("MASSZONING.xls")
What is the minimal required plot size; create a histogram with binsize of 10.
mu_clparcel <- mean(masszoning$clparcel, na.rm = TRUE)
mu_clparcel
## [1] 8.506781
min_parcel <- ggplot(masszoning, aes(x=clparcel), na.rm = TRUE)+
geom_histogram(bins = 10, color = "white", fill = "light blue")+
geom_vline(aes(xintercept=mu_clparcel), color = "blue", linetype = "dashed", size = 1)+
labs(title = "Minimum Required Parcel Size", x = 'parcel size')+
theme(panel.background = element_rect(fill = 'white', color = 'grey'),
panel.grid.major = element_line(color = 'lightgrey', size = .2),
panel.grid.minor = element_line(color = 'lightgrey', size = .1))
min_parcel
## Warning: Removed 49 rows containing non-finite values (stat_bin).
What is the median minimum plot size.
median(masszoning$clparcel, na.rm = TRUE)
## [1] 7.75
Display the histogram of the distribution of open space requirements in new cluster developments (variable name: clopen), using 40 equally-spaced bins. Can you see any interesting numerical patterns?
openspace <- ggplot(masszoning, aes(x = clopen), na.rm = TRUE)+
geom_histogram(bins = 40, color = "white", fill = "lightgreen")+
labs(title = 'Open Space Requirements in New Cluster Developments', x = 'open space requirement')+
theme(panel.background = element_rect(fill = "white", color = 'black'),
panel.grid.major = element_line(color = 'lightgrey', size = .2),
panel.grid.minor = element_line(color = 'lightgrey', size = .1))
openspace
## Warning: Removed 61 rows containing non-finite values (stat_bin).
Looking at the graph above, the incremental number for required open
space seems to be 5. *** #### Question 4: What percentage of towns
exclude wetlands, easements, or sloped land from calculations of minimum
land area requirements (variable name: mlaexclud)? Does this exclusion
make it harder or easier to develop housing and other real estate
there?
percentage_exclusion <- sum(masszoning$mlaexclud)/nrow(masszoning)
percentage_exclusion
## [1] 0.6256684
The percentage is 62.5% The exclusion made less buildable land available. However, it does not make the development there harder (or how we define harder). Wetlands are protected by EPA and are important to preserve for LEED. Easement may require going around laws and more capitals for settlement. Developing on slope also require more money for construction (breaking rocks and laying foundations)
What percentage of towns impose shape rules on lots for development (variable name: shaprule)? What do you think might be their rationale to do so?
percentage_shaperules <- sum(masszoning$shaprule != 0)/nrow(masszoning)
percentage_shaperules
## [1] 0.4331551
The percentage is 43.3% Shaperule may help prevent developments to take up too much (if not all) lot floor areas. The setbacks can be for green space / public uses etc
What fraction of municipalities have inclusionary zoning provisions (in variable include)? Of which type? Show your results in a bar chart or other graph that correctly represents numerical proportions. You can label the chart if you want but there is no need to.
inclusion <- data.frame("Percentage" = c(percent(sum(masszoning$include == 0) / nrow(masszoning)),
percent(sum(masszoning$include == 1) / nrow(masszoning)),
percent(sum(masszoning$include == 2) / nrow(masszoning)),
percent(sum(masszoning$include == 3) / nrow(masszoning))),
"Types" = c('No inclusionary','Optional','Mandatory','Both optional and mandatory')
)
#percent(sum(masszoning$include == 1) / nrow(masszoning))
inclusion$Types <- factor(inclusion$Types, inclusion$Types[order(inclusion$Percentage, decreasing = TRUE)])
inclusion
## Percentage Types
## 1 47% No inclusionary
## 2 21% Optional
## 3 19% Mandatory
## 4 13% Both optional and mandatory
str(inclusion)
## 'data.frame': 4 obs. of 2 variables:
## $ Percentage: chr "47%" "21%" "19%" "13%"
## $ Types : Factor w/ 4 levels "No inclusionary",..: 1 2 3 4
ggplot(inclusion, aes(x = "", y = Percentage, fill = Types))+
geom_bar(stat="identity", width=1)+
geom_text(aes(label = Percentage),
color = "blue",
position = position_stack(vjust = 0.5)) +
coord_polar(theta = "y")+
scale_fill_brewer("Types",palette = 2, direction = -1) +
labs(title = "Percentage of Inclusionary Zoning Provisions", x = '', y = '')
inclusion %>% print(.$Types)
## Percentage Types
## 1 47% No inclusionary
## 2 21% Optional
## 3 19% Mandatory
## 4 13% Both optional and mandatory
Some municipalities offer density bonuses—the ability to build more housing units than allowed as by zoning right—to developers erecting affordable housing. Tabulate the variable capturing the availability of such bonuses (variable name: incbonus) conditional on the town reporting any affordable units built under the inclusionary zoning provisions (variable name: incdevs). Do the same for towns that report no development under current affordable housing provisions. Can you draw a preliminary—prima facie—hypothesis about the effectiveness of density bonuses in this environment
df_n <- masszoning[c('incdevs','incbonus')] %>% na.omit()
ggplot(df_n, aes(x = incbonus)) +
geom_histogram(bins = 10, color = "white", fill = "hotpink") +
labs(title = "Bonus Density", x = 'bonus density grant types')
One of the variables in the survey captures whether the town allows apartments above ground-floor commercial uses (variable name: mfmixed). Another question asks which process (e.g., special permit) is used for developers to be allowed to build multi-family housing, if they are at all (variable name: mfallow). Provide cross-tabulations of these two variables. What is the combination of the two that is more frequent in suburban Massachusetts?
mftab <- masszoning[c('mfmixed','mfallow')] #subsetting df with only mfmixed and mfallow
crosstab_mf <- xtabs(~mfallow+mfmixed, data = mftab)
plot_xtab(mftab$mfallow, mftab$mfmixed, margin = "row", bar.pos = "stack", coord.flip = FALSE)+
theme_sjplot(base_size = 10, base_family = "")
Some municipalities allow attached single-family homes, others do not (variable name: townhous). Similarly, some allow accessory units (e.g., a rental unit on the basement or attic)–variable accesapt. Cross-tabulate these variables. Do you see any notable patterns?
attachroomtab <- masszoning[c('accesapt','townhous')] #subsetting df
crosstab_attachroom <- xtabs(~accesapt+townhous, data = attachroomtab)
plot_xtab(attachroomtab$accesapt, attachroomtab$townhous, margin = "row", bar.pos = "stack", coord.flip = FALSE)
Thank you:)