library(data.table)
library(ggplot2)
#Q1
d0<-fread("https://opportunityinsights.org/wp-content/uploads/2018/10/tract_covariates.csv")
#Q2
d2 <- d0[,c('czname','hhinc_mean2000','popdensity2000')]
#Q3
SA <- d2[d0$czname=='San Antonio',]
#Q4
ggplot(SA, aes(x = hhinc_mean2000)) + geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_bin()`).

#Q5
ggplot(SA, aes(x = hhinc_mean2000)) + geom_density()
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_density()`).

#Q6
ggplot(SA, aes(x = hhinc_mean2000)) + stat_ecdf()
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_ecdf()`).

#Q7
ggplot(data = SA, aes(x = SA$popdensity2000, y = SA$hhinc_mean2000)) + geom_point()
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).
