setwd("C:/Users/s-das/Syncplicity Folders/LA Alcohol-Impaired Driving Project/Task 4__InterimReport/Relevant_Stat/Crash_ShapeFiles/KA")
library(foreign)
library(sf)
library(ggplot2)
library(stats)
all <- st_read("LA_AlcImpaired_KA.shp")
## Reading layer `LA_AlcImpaired_KA' from data source `C:\Users\s-das\Syncplicity Folders\LA Alcohol-Impaired Driving Project\Task 4__InterimReport\Relevant_Stat\Crash_ShapeFiles\KA\LA_AlcImpaired_KA.shp' using driver `ESRI Shapefile'
## Simple feature collection with 2546 features and 12 fields
## geometry type:  POINT
## dimension:      XY
## bbox:           xmin: -94.04202 ymin: 29.14207 xmax: -89.38766 ymax: 33.01861
## epsg (SRID):    4269
## proj4string:    +proj=longlat +datum=NAD83 +no_defs
all1 <- subset(all, longitude < -90)
ggplot(all1, aes(size = INTERSECTI, colour = CRASH_YEAR)) +
  geom_sf(show.legend = "point", alpha = 0.3) +
  facet_grid(vars(SEVERITY_C), vars(INTERSEC_1)) +
  scale_size(
    breaks = c(1:3, 12),
    labels = c(1:2, "3+", 12)
  ) +theme_bw()+
  scale_color_gradientn(colours = c("blue", "yellow", "red")) +
  theme(axis.text = element_blank(), axis.ticks = element_blank())

## Linking to GEOS 3.5.0, GDAL 2.2.2, PROJ 4.8.0
setwd("C:/Users/s-das/Syncplicity Folders/LA Alcohol-Impaired Driving Project/Task 4__InterimReport/Relevant_Stat/Crash_ShapeFiles/KABCO")
all <- st_read("Alc_KABCO.shp")
## Reading layer `Alc_KABCO' from data source `C:\Users\s-das\Syncplicity Folders\LA Alcohol-Impaired Driving Project\Task 4__InterimReport\Relevant_Stat\Crash_ShapeFiles\KABCO\Alc_KABCO.shp' using driver `ESRI Shapefile'
## Simple feature collection with 38820 features and 12 fields
## geometry type:  POINT
## dimension:      XY
## bbox:           xmin: -1.797693e+308 ymin: -1.797693e+308 xmax: -89.05659 ymax: 33.06336
## epsg (SRID):    4269
## proj4string:    +proj=longlat +datum=NAD83 +no_defs
all1 <- subset(all, longitude < -90)
ggplot(all1, aes(size = INTERSECTI, colour = INTERSEC_1)) +
  geom_sf(show.legend = "point", alpha = 0.3) +
  facet_grid(vars(SEVERITY_C), vars(CRASH_YEAR)) +
  scale_size(
    breaks = c(1:3, 12),
    labels = c(1:2, "3+", 12)
  ) +theme_bw()+
  scale_color_gradientn(colours = c("blue", "yellow", "red")) +
  theme(axis.text = element_blank(), axis.ticks = element_blank())

## Linking to GEOS 3.5.0, GDAL 2.2.2, PROJ 4.8.0