Today we’re working on data exploration, analysis, and visualization in R, and to motivate our work we’ll use the following running example.
The focus of the Water Resources Program is to maintain healthy rivers and streams by monitoring part of the Meduxnekeag River Watershed located in Southern Aroostook County, Maine. This area is part of the Wolastoq (St. John River) system that flows through Canada and into the Bay of Fundy. Land uses are predominantly forestry and agricultural, with urban and commercial areas concentrated in Houlton proper. There are two point-source dischargers within the watershed located on the mainstem:
A key initial question that we want to ask is, do water quality parameters such as temperature, pH, specific conductivity and dissolved oxygen change with stream flow? If so, how, and what are the implications? We can also include local water quality standards on the plots to see how the observed values compare.
To address this, we compile and examine data on these variables from two different sources: USGS for the stream flow, and water quality measurements from the Houlton Band of Maliseet Indians for site 18.9 MDX using a multiparameter sonde that collects measurements every half hour.
Skills used in this dashboard:
dataRetrieval packagetidyverse: mutate, group_by, and summarize| Month | TempAbove22.2 | TempAbove25.6 | pHBelow7 | pHAbove8.5 | DOBelow7 |
|---|---|---|---|---|---|
| 6 | 111 | 3 | 0 | 64 | 0 |
| 7 | 778 | 141 | 0 | 357 | 75 |
| 8 | 515 | 112 | 0 | 200 | 18 |
| 9 | 27 | 0 | 0 | 125 | 0 |
These statistics summarize how many times temperature, pH, and DO are too high or too low over the course of the year.
The water temperatures in this dataset were more often too high than too low. The pH was never too acidic but sometimes too basic. Less frequently, there was sometimes too little dissolved oxygen in the water.
As expected, water temperature was highest in July and August. Temperature then increased sharply in September. Specific conductivity, which increases with temperature, mirrored this increase and decrease in the summer and increase in September.