4 Sites, assessment units, and beneficial uses

4.1 Merge site locations to data

tds_sites=merge(tds_sw, sites)
dim(tds_sites) #Note, some TDS records were not associated with a known site
## [1] 12716    95

4.2 TDS records w/o a site:

kableExtra::scroll_box(knitr::kable(subset(tds_sw,!MonitoringLocationIdentifier%in%sites$MonitoringLocationIdentifier)), width="100%", height="500px")
OrganizationIdentifier OrganizationFormalName ActivityIdentifier ActivityTypeCode ActivityMediaName ActivityMediaSubdivisionName ActivityStartDate ActivityStartTime.Time ActivityStartTime.TimeZoneCode ActivityEndDate ActivityEndTime.Time ActivityEndTime.TimeZoneCode ActivityDepthHeightMeasure.MeasureValue ActivityDepthHeightMeasure.MeasureUnitCode ActivityDepthAltitudeReferencePointText ActivityTopDepthHeightMeasure.MeasureValue ActivityTopDepthHeightMeasure.MeasureUnitCode ActivityBottomDepthHeightMeasure.MeasureValue ActivityBottomDepthHeightMeasure.MeasureUnitCode ProjectIdentifier ActivityConductingOrganizationText MonitoringLocationIdentifier ActivityCommentText SampleAquifer HydrologicCondition HydrologicEvent SampleCollectionMethod.MethodIdentifier SampleCollectionMethod.MethodIdentifierContext SampleCollectionMethod.MethodName SampleCollectionEquipmentName ResultDetectionConditionText CharacteristicName ResultSampleFractionText ResultMeasureValue ResultMeasure.MeasureUnitCode MeasureQualifierCode ResultStatusIdentifier StatisticalBaseCode ResultValueTypeName ResultWeightBasisText ResultTimeBasisText ResultTemperatureBasisText ResultParticleSizeBasisText PrecisionValue ResultCommentText USGSPCode ResultDepthHeightMeasure.MeasureValue ResultDepthHeightMeasure.MeasureUnitCode ResultDepthAltitudeReferencePointText SubjectTaxonomicName SampleTissueAnatomyName ResultAnalyticalMethod.MethodIdentifier ResultAnalyticalMethod.MethodIdentifierContext ResultAnalyticalMethod.MethodName MethodDescriptionText LaboratoryName AnalysisStartDate ResultLaboratoryCommentText DetectionQuantitationLimitTypeName DetectionQuantitationLimitMeasure.MeasureValue DetectionQuantitationLimitMeasure.MeasureUnitCode PreparationStartDate ProviderName
4726 952307_WQX LT Environmental Inc.  952307_WQX-D71862-1 Sample-Routine Water NA 2015-06-15 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Gate Canyon Spring 1 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 2270 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-06-22 NA Practical Quantitation Limit 10 mg/l NA STORET
4727 952307_WQX LT Environmental Inc.  952307_WQX-D75226-1 Sample-Routine Water NA 2015-09-15 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Gate Canyon Spring 1 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 3070 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-09-21 NA Practical Quantitation Limit 10 mg/l NA STORET
4728 952307_WQX LT Environmental Inc.  952307_WQX-D80330-1 Sample-Routine Water NA 2016-02-29 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Gate Canyon Spring 1 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1770 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2016-03-02 NA Practical Quantitation Limit 10 mg/l NA STORET
4729 952307_WQX LT Environmental Inc.  952307_WQX-D83360-1 Sample-Routine Water NA 2016-06-06 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Gate Canyon Spring 1 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 2770 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2016-06-09 NA Practical Quantitation Limit 10 mg/l NA STORET
4730 952307_WQX LT Environmental Inc.  952307_WQX-D87208-1 Sample-Routine Water NA 2016-09-26 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Gate Canyon Spring 1 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1840 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2016-09-29 NA Practical Quantitation Limit 10 mg/l NA STORET
4731 952307_WQX LT Environmental Inc.  952307_WQX-D68892-1 Sample-Routine Water NA 2015-03-18 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 1 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1940 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-03-23 NA Practical Quantitation Limit 10 mg/l NA STORET
4732 952307_WQX LT Environmental Inc.  952307_WQX-D71860-1 Sample-Routine Water NA 2015-06-15 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 1 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1670 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-06-22 NA Practical Quantitation Limit 10 mg/l NA STORET
4733 952307_WQX LT Environmental Inc.  952307_WQX-D83359-1 Sample-Routine Water NA 2016-06-06 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 1 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1870 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2016-06-09 NA Practical Quantitation Limit 10 mg/l NA STORET
4734 952307_WQX LT Environmental Inc.  952307_WQX-D87209-1 Sample-Routine Water NA 2016-09-26 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 1 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1810 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2016-09-29 NA Practical Quantitation Limit 10 mg/l NA STORET
4735 952307_WQX LT Environmental Inc.  952307_WQX-D68892-2 Sample-Routine Water NA 2015-03-18 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 2 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1290 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-03-24 NA Practical Quantitation Limit 10 mg/l NA STORET
4736 952307_WQX LT Environmental Inc.  952307_WQX-D71863-1 Sample-Routine Water NA 2015-06-15 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 2 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1400 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-06-22 NA Practical Quantitation Limit 10 mg/l NA STORET
4737 952307_WQX LT Environmental Inc.  952307_WQX-D75225-1 Sample-Routine Water NA 2015-09-15 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 2 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1610 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-09-21 NA Practical Quantitation Limit 10 mg/l NA STORET
4738 952307_WQX LT Environmental Inc.  952307_WQX-D77806-1 Sample-Routine Water NA 2015-12-01 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 2 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1340 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-12-07 NA Practical Quantitation Limit 10 mg/l NA STORET
4739 952307_WQX LT Environmental Inc.  952307_WQX-D80333-1 Sample-Routine Water NA 2016-02-29 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 2 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1320 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2016-03-02 NA Practical Quantitation Limit 10 mg/l NA STORET
4740 952307_WQX LT Environmental Inc.  952307_WQX-D83357-1 Sample-Routine Water NA 2016-06-06 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 2 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1520 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2016-06-09 NA Practical Quantitation Limit 10 mg/l NA STORET
4741 952307_WQX LT Environmental Inc.  952307_WQX-D87210-1 Sample-Routine Water NA 2016-09-26 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 2 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1920 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2016-09-29 NA Practical Quantitation Limit 10 mg/l NA STORET
4742 952307_WQX LT Environmental Inc.  952307_WQX-DA3825-1 Sample-Routine Water NA 2018-03-25 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 2 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1570 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2018-03-29 NA Practical Quantitation Limit 10 mg/l NA STORET
4743 952307_WQX LT Environmental Inc.  952307_WQX-D68892-3 Sample-Routine Water NA 2015-03-18 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 3 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1850 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-03-24 NA Practical Quantitation Limit 10 mg/l NA STORET
4744 952307_WQX LT Environmental Inc.  952307_WQX-D71861-1 Sample-Routine Water NA 2015-06-15 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 3 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1930 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-06-22 NA Practical Quantitation Limit 10 mg/l NA STORET
4745 952307_WQX LT Environmental Inc.  952307_WQX-D75224-1 Sample-Routine Water NA 2015-09-15 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 3 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 2240 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2015-09-21 NA Practical Quantitation Limit 10 mg/l NA STORET
4746 952307_WQX LT Environmental Inc.  952307_WQX-D80332-1 Sample-Routine Water NA 2016-02-29 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 3 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 2250 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2016-03-02 NA Practical Quantitation Limit 10 mg/l NA STORET
4747 952307_WQX LT Environmental Inc.  952307_WQX-D83356-1 Sample-Routine Water NA 2016-06-06 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 3 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 1960 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2016-06-09 NA Practical Quantitation Limit 10 mg/l NA STORET
4748 952307_WQX LT Environmental Inc.  952307_WQX-DA6575-1 Sample-Routine Water NA 2018-06-24 NA NA NA NA NA NA NA NA NA NA NA NA GASCO - 030812003 NA 952307_WQX-Rye Spring 3 NA NA NA NA LTE_SWC Sample Collection Surface water collection Water Bottle NA Total dissolved solids Total 2870 mg/l NA Final NA Actual NA NA NA NA NA NA NA NA NA NA NA NA 2540-C APHA Total Dissolved Solids in Water https://www.nemi.gov/methods/method_summary/9818/ NA 2018-06-28 NA Practical Quantitation Limit 10 mg/l NA STORET

4.3 Check site types present

knitr::kable(table(droplevels(tds_sites$MonitoringLocationTypeName),tds_sites$ProviderName), caption="Site types present in TDS dataset")
Table 4.1: Site types present in TDS dataset
NWIS STORET
Canal Drainage 0 85
Canal Irrigation 0 6
Canal Transport 0 54
Facility Other 0 337
Lake 0 1221
Lake, Reservoir, Impoundment 358 0
Land 18 0
River/Stream 0 6094
Spring 120 131
Storm Sewer 0 18
Stream 2488 0
Subsurface: Groundwater drain 34 0
Subsurface: Tunnel, shaft, or mine 38 0
Waste Sewer 0 9
Well 1580 104
Wetland Undifferentiated 0 21

4.4 Lump canal types, subset to lakes, streams, and canals,

dim(tds_sites)
## [1] 12716    95
levels(tds_sites$MonitoringLocationTypeName)=append(levels(tds_sites$MonitoringLocationTypeName),"Canal")
tds_sites$MonitoringLocationTypeName[tds_sites$MonitoringLocationTypeName %in% c("Canal Drainage","Canal Irrigation","Canal Transport")]="Canal"
tds_sites=subset(tds_sites, MonitoringLocationTypeName %in% c("River/Stream","Stream","Lake","Lake, Reservoir, Impoundment","Canal"))
dim(tds_sites)
## [1] 10306    95
knitr::kable(table(droplevels(tds_sites$MonitoringLocationTypeName),tds_sites$ProviderName), caption="Site types present in TDS dataset following subset to desired site types and grouping canals to single type.")
Table 4.2: Site types present in TDS dataset following subset to desired site types and grouping canals to single type.
NWIS STORET
Lake 0 1221
Lake, Reservoir, Impoundment 358 0
River/Stream 0 6094
Stream 2488 0
Canal 0 145

4.5 Assign assessment units (& AU waterbody types)

tds_sites=assignAUs(tds_sites)
knitr::kable(table(tds_sites$ProviderName, tds_sites$AU_Type), caption="AU types present in TDS dataset by database provider.")
Table 4.3: AU types present in TDS dataset by database provider.
Canal Reservoir/Lake River/Stream Slough
NWIS 0 358 2319 0
STORET 24 1294 5729 69

4.6 Assign beneficial uses

tds_sites_uses=assignUses(tds_sites, flatten=T)
knitr::kable(table(tds_sites_uses$AU_Type, tds_sites_uses$BeneficialUse))  
1C 2A 2B 3A 3B 3C 3D 4 5A 5B 5C
Canal 0 0 24 0 24 0 24 24 0 0 0
Reservoir/Lake 823 788 533 888 433 0 312 1317 182 70 79
River/Stream 3371 882 7166 4750 2049 1229 726 7700 0 0 0
Slough 0 0 69 0 57 12 51 57 0 0 0

Flattening output so all uses can be plotted. Note that individual results are now duplicated when multiple uses apply to a site.