library(ggplot2)
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
d0<-read.csv("C:/Users/adrian.gallegos/OneDrive - BASIS.ed/Desktop/FALL UTSA/HW1/tract_covariates.csv")
df <- d0[, c("czname", "hhinc_mean2000", "popdensity2000")]
df <- df[df$czname == 'San Antonio', ]
ggplot(df, 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()`).

ggplot(df, aes(y = popdensity2000)) +
geom_boxplot()

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

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

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

ggplot(df, aes(x = hhinc_mean2000 , )) +
stat_ecdf() +
labs(x = "Household Income", y = "Cumulative Percent")
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_ecdf()`).

ggplot(df, aes(x = popdensity2000, y = hhinc_mean2000)) +
geom_point() +
labs(x = "Population Density", y = "Household Income")
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).

ggplotly()