library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.6
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.1     ✔ 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)

district <- read_excel("district.xls")
new_data <- district %>% select(DISTNAME, DPETSPEP, DPFPASPEP)
summary(new_data)
##    DISTNAME            DPETSPEP       DPFPASPEP     
##  Length:1207        Min.   : 0.00   Min.   : 0.000  
##  Class :character   1st Qu.: 9.90   1st Qu.: 5.800  
##  Mode  :character   Median :12.10   Median : 8.900  
##                     Mean   :12.27   Mean   : 9.711  
##                     3rd Qu.:14.20   3rd Qu.:12.500  
##                     Max.   :51.70   Max.   :49.000  
##                                     NA's   :5
# DPFPASPEP has missing data - command below will remove the missing data values

new_data_no_missing <- new_data %>% drop_na()

#After removing missing values, 1202 values are leftover
ggplot(new_data_no_missing,aes(x=DPETSPEP, y=DPFPASPEP)) + geom_point()

cor(new_data_no_missing$DPETSPEP, new_data_no_missing$DPFPASPEP)
## [1] 0.3700234
# Value indicates a low correlation. Graph does represent this as there is a wide spread of values - strong correlation would have less spread