library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.2.0     ✔ readr     2.1.6
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.2     ✔ tibble    3.3.1
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.2
## ✔ purrr     1.2.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readxl)
TEA_Data<-read_excel("district.xls")
community<-TEA_Data %>% select(DISTNAME,COMMTYPE,DPETALLC,DZRVLOCP)
summary(TEA_Data$DZRVLOCP)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   -6.20   21.10   35.30   37.92   53.70   97.60       5
summary(TEA_Data$DPETALLC)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##      4.0    337.5    884.0   4476.3   2746.0 193727.0
hist(TEA_Data$DZRVLOCP)

plot(TEA_Data$DZRVLOCP,TEA_Data$DPETALLC)

TEA_Data_Clean<-community%>% drop_na(DZRVLOCP)
cor(TEA_Data_Clean$DZRVLOCP,TEA_Data_Clean$DPETALLC)
## [1] 0.1288399