library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.0.2
## ── 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
Pavements is data from the City of San Antonio public data https://opendata-cosagis.opendata.arcgis.com/
pavements<-read.csv("pavements_3192083553624189959.csv")
summary(pavements$PCI)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.00 76.60 87.00 78.86 87.00 99.99
summary(pavements$Shape__Length)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.701 265.014 373.017 577.332 692.186 20648.482
hist(pavements$PCI)
(ggplot is fine if you are comfortable with it)
ggplot(pavements,aes(x=PCI,y=Shape__Length)) + geom_point()
I feel like i should clean up my data to allow for a range (0-10, 11-20,
21-30, etc.) and use box plots to represent the data.
cor(pavements$PCI,pavements$Shape__Length)
## [1] 0.05382792
PCI and Street Length are only 5% correlated.
I feel a better correlation would be between the road function or maintenance responsibility and the PCI. I would need to change the character into numerical. Could this be done in R?