6 TDS analyses

6.1 Plot TDS by year & month

tds_sites_uses=within(tds_sites_uses,{
    year=lubridate::year(ActivityStartDate)
    month=lubridate::month(ActivityStartDate)
})

boxplot(ResultMeasureValue~as.factor(year),tds_sites_uses, ylab="TDS (mg/L)", xlab="Year")

boxplot(ResultMeasureValue~as.factor(month),tds_sites_uses, ylab="TDS (mg/L)", xlab="Month")

Some of the really high values are probably coming from Great Salt Lake sampling sites. Remove those and try again.

6.2 Remove GSL sites

dim(tds_sites_uses)
## [1] 33640   105
tds_sites_uses=subset(tds_sites_uses, !BeneficialUse %in% c("5A","5B","5C","5D","5E"))
dim(tds_sites_uses)
## [1] 33309   105
boxplot(ResultMeasureValue~year,tds_sites_uses, ylab="TDS (mg/L)", xlab="Year")

boxplot(ResultMeasureValue~month,tds_sites_uses, ylab="TDS (mg/L)", xlab="Month")

That looks better. Still some high values, but they appear to be coming from non-GSL waterbodies. Find these sites…

6.3 Find sites w/ TDS values > 5000 recorded

tds_5000=subset(tds_sites_uses, ResultMeasureValue >=5000)
sites_tds_5000=subset(sites, MonitoringLocationIdentifier %in% tds_5000$MonitoringLocationIdentifier)
buildMap(sites=sites_tds_5000)

6.4 Plot TDS by lat & long

par(mfrow=c(1,2))
plot(ResultMeasureValue~LongitudeMeasure, tds_sites_uses, xlab="Longitude (dd)", ylab="TDS (mg/L)", log='y')
plot(ResultMeasureValue~LatitudeMeasure, tds_sites_uses, xlab="Latitude (dd)", ylab="TDS (mg/L)", log='y')

No obvious north/south or east/west patterns

6.5 Plot TDS by use

boxplot(ResultMeasureValue~BeneficialUse, tds_sites_uses, ylab="TDS (mg/L)", log='y', xlab="Beneficial use class")

6.6 Plot TDS by AU waterbody type

boxplot(ResultMeasureValue~AU_Type, tds_sites_uses, log='y', ylab="TDS (mg/L)", xlab="AU waterbody type")