generated from jhudsl/OTTR_Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
06-module_tier_2.Rmd
57 lines (46 loc) · 2.65 KB
/
06-module_tier_2.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# (PART\*) Module - Tier 2 {-}
# Introduction
EJ Screen incorporates many different data sources. Let’s dig into one of the data sources that is part of EJ screen so we can understand it better.
We will import the data source used to make the wastewater index that is part of the EJ screen tool.
# Activity
Looking at the EJ Screen website, wastewater discharge is an EJ factor in many Southern California regions.
We can dive into the data and look at the content of the wastewater in two different rural counties: Riverside and Imperial
![](assets/ca_wastewater.png)
We find that the chemical composition is very different! These are also counties with large amounts of agricultural run-off, but these are not accounted for in this database. The nitrate wastewater runoff in Imperial county is from the US Navy.
![](assets/imperial.png)
![](assets/riverside.png)
```{r eval = FALSE}
library(ggplot2)
data <- read.csv(file = ‘TRI_table_CA2.csv’)
county_name = “IMPERIAL”
county = data[data$COUNTY_NAME == county_name,]
## What do the columns mean?
# TOTAL_PRODUCTION_RELATED_WASTE. = sum of all reports
# TOTAL_PRODUCTION_RELATED_WASTE..1 = average of all reports
# TOTAL_PRODUCTION_RELATED_WASTE..2 = count of reports
# county$TOTAL_PRODUCTION_RELATED_WASTE..5 = std of all reports
# county$TOTAL_PRODUCTION_RELATED_WASTE..6 = variance of all reports
## Plot total by facility
county1 = aggregate(x = county$TOTAL_PRODUCTION_RELATED_WASTE., # Specify data column
by = list(county$FACILITY_NAME), # Specify group indicator
FUN = sum)
county1 <- county1[order(county1$x),]
p<-ggplot(data=county1, aes(x=Group.1, y=x)) +
geom_bar(stat = ‘identity’)
p + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
## Plot total by chemical
chemical = aggregate(x = county$TOTAL_PRODUCTION_RELATED_WASTE., # Specify data column
by = list(county$CAS_CHEM_NAME), # Specify group indicator
FUN = sum)
p<-ggplot(data=chemical, aes(x=Group.1, y=x)) +
geom_bar(stat = ‘identity’)
p + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
## Plot chemicals that are released into the water
county_water <- county[county$WATER_TOTAL_RELEASE > 0,]
chemical = aggregate(x = county_water$WATER_TOTAL_RELEASE, # Specify data column
by = list(county_water$CAS_CHEM_NAME), # Specify group indicator
FUN = sum)
p<-ggplot(data=chemical, aes(x=Group.1, y=x)) +
geom_bar(stat = ‘identity’)
p + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
```