R Markdown

library(magrittr)
## Warning: package 'magrittr' was built under R version 3.3.2
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.3.3
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.3.3
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(kableExtra)
## Warning: package 'kableExtra' was built under R version 3.3.3
library(knitr)
library(formattable)
## Warning: package 'formattable' was built under R version 3.3.3
Demographic <- read.csv("LIHTC-Demographic.csv")
Demographic %<>% rename(Neighborhood = "ï..Neighborhood")
Value <- read.csv("LIHTC-Value.csv")
Value %<>% rename(Neighborhood = "ï..Neighborhood")
Numbers <- read.csv("LIHTC-Number.csv")
Numbers %<>% rename(Neighborhood = "ï..Neighborhood")
Change <- 0.5

Demographic$Median.Income..2000. <- currency(Demographic$Median.Income..2000.,digits = 0)

Demographic$Median.Income..2010. <- currency(Demographic$Median.Income..2010.,digits = 0)

Demographic$Median.Income..2015. <- currency(Demographic$Median.Income..2015.,digits = 0)

Demographic %>% filter((Median.Income..2000.*Change > Median.Income..2010. | Median.Income..2000.*Change > Median.Income..2015.) & City == "Charlotte") %>% select(Neighborhood,City,Median.Income..2000., Median.Income..2010., Median.Income..2015.) %>% kable("html") %>% kable_styling(bootstrap_options = "striped", full_width = F) 
## Warning: package 'bindrcpp' was built under R version 3.3.3
Neighborhood City Median.Income..2000. Median.Income..2010. Median.Income..2015.
Beverly Woods Charlotte $72,455 $19,126 $21,043
Chantilly Charlotte $33,541 $11,491 $12,103
Country Club Heights Charlotte $50,267 $24,129 $25,393
Eastfield Charlotte $75,532 $19,010 $15,569
Eastover Charlotte $142,290 $27,718 $33,065
Johnston Rd.-McAlpine Charlotte $52,908 $24,209 $31,524
Mallard Creek - Withrow Downs Charlotte $79,903 $56,813 $39,627
Montibello Charlotte $120,520 $40,788 $35,832
Newell South Charlotte $47,075 $23,214 $32,150
Providence Plantation Charlotte $110,289 $25,887 $26,569
Quail Hollow Charlotte $65,977 $35,551 $30,055
Seven Eagles Charlotte $75,595 $27,360 $43,459
Stonehaven Charlotte $65,553 $33,317 $27,517
Wendover-Sedgewood Charlotte $56,607 $27,364 $43,470
Wessex Square Charlotte $76,226 $21,878 $23,265
# Value %<>% mutate(Difference = Dec.17-Jan.97, Grps = "A")
# 
# Value %<>% filter(!is.na(Difference)) 
# 
# Value$Grps[Value$Jan.97 > quantile(Value$Jan.97,0.50,na.rm = TRUE) & Value$Jan.97 <= quantile(Value$Jan.97,0.75,na.rm = TRUE)] <- "B"
# 
# Value$Grps[Value$Jan.97 > quantile(Value$Jan.97,0.25,na.rm = TRUE) & Value$Jan.97 <= quantile(Value$Jan.97,0.50,na.rm = TRUE)] <- "C"
# 
# Value$Grps[Value$Jan.97 <= quantile(Value$Jan.97,0.24,na.rm = TRUE)] <- "D"
# 
# Value$LIHTC.Present...0...No..1...Yes. <- as.character(Value$LIHTC.Present...0...No..1...Yes.)
# 
# Value %<>% rename("LIHTC" = "LIHTC.Present...0...No..1...Yes.")
# 
# Value %>% ggplot(aes(x=LIHTC,y=Difference)) 
# + geom_bar()
# + facet_grid(. ~ Grps)
# 
# Value %>% ggplot(aes(x=Grps,y=Difference))
# + geom_bar()
# + facet_grid(. ~ LIHTC)
# 
# Value %>% ggplot(aes(x=Grps,y=Difference))
# + geom_bar()
# + facet_grid(. ~ Grps)
# 
# Demographic %>% filter(Population..2000. > 9000) %>%    ggplot(aes(x=Neighborhood,y=Population..2000.))
# + geom_col()