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:

  1. a starch factory located 10 miles downstream from the headwaters, and
  2. a waste-water treatment plant located approximately 16 miles from the headwaters approximately 2.3 miles upstream from tribal lands.

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:

  • Reading data into R from a csv file
  • Reading data into R directly from the USGS database using the dataRetrieval package
  • Data manipulation with tidyverse: mutate, group_by, and summarize
  • Joining datasets
  • Visualizing multivariate time series data
Water parameters over time, separate
Water parameters over time, together
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.

  • High water temperatures reduce dissolved oxygen levels which suffocates fish. High temperatures can also increase fish metabolic stress and trigger toxic algal blooms.
  • Low water temperatures might be too cold for species living in the water to tolerate. Low temperatures also reduce fish metabolic rates and can change invertebrate life cycles or disrupt natural food webs.
Summary

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.