myDat <- subset(dat_yearly, myState=="WA")
RI <- subset(myDat, Facility_Type=="0_RI")
R2 <- subset(myDat, Facility_Type=="1_R2L")
RMU <- subset(myDat, Facility_Type=="2_RMU")
RMD <- subset(myDat, Facility_Type=="3_RMD")
Rural Interstate
RI_a <- RI[,c("Total", "DISTANCE", "AADT", "NO_LANES", "MEDWID",
"SURF_WID", "OptSpd", "SpdVarr1", "SpdVarr2", "SpdVarr3",
"SpdVarr4", "SpdAvg", "SpdFF")]
library("PerformanceAnalytics")
## Warning: package 'PerformanceAnalytics' was built under R version 3.5.2
## Loading required package: xts
## Warning: package 'xts' was built under R version 3.5.2
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
##
## Attaching package: 'xts'
## The following objects are masked from 'package:data.table':
##
## first, last
##
## Attaching package: 'PerformanceAnalytics'
## The following object is masked from 'package:graphics':
##
## legend
chart.Correlation(RI_a, histogram=TRUE, pch=19)
Rural Two-lane
R2_a <- R2[,c("Total", "DISTANCE", "AADT",
"SURF_WID", "OptSpd", "SpdVarr1", "SpdVarr2", "SpdVarr3",
"SpdVarr4", "SpdAvg", "SpdFF")]
R2_b <- subset(R2_a, OptSpd < 100)
library("PerformanceAnalytics")
chart.Correlation(R2_b, histogram=TRUE, pch=19)
Rural Multilane Divided
RMD_a <- RMD[,c("Total", "DISTANCE", "AADT", "NO_LANES", "MEDWID",
"SURF_WID", "OptSpd", "SpdVarr1", "SpdVarr2", "SpdVarr3",
"SpdVarr4", "SpdAvg", "SpdFF")]
library("PerformanceAnalytics")
chart.Correlation(RMD_a, histogram=TRUE, pch=19)
Rural Multilane Undivided
RMU_a <- RMU[,c("Total", "DISTANCE", "AADT", "NO_LANES",
"SURF_WID", "OptSpd", "SpdVarr1", "SpdVarr2", "SpdVarr3",
"SpdVarr4", "SpdAvg", "SpdFF")]
library("PerformanceAnalytics")
chart.Correlation(RMU_a, histogram=TRUE, pch=19)