View on GitHub

R-Shiny apps

Oak Ridges Moraine Groundwater Program

R-Shiny apps

General description


The Oak Ridges Moraine Groundwater Program (ORMGP) hosts an R-Shiny server from which users are provided an interactive interface to time-series analysis of data queried directly from our central database.

sHydrology is a set of dynamic hydrological analyses packages written to improve access to environmental monitoring databases through a variety of workflows, statistics and perspectives.


The sHydrology web application provides a collection of analytical tools written to improve workflow at the ORMGP. These tools were scripted in R to replace our past/inefficient practice of querying data, cleaning/infilling data, re-formatting data, analysing and plotting data, output figures and tables every time we need to provide figure for reporting. While these tools can be found on ORMGP web site, and the source code is open and free, we are not developing an application for distribution and support, rather we are exposing our internal workflows to our partners.


The sHydrology web packages originated from a set of scripts I had created over the years, mostly written in Basic. Recently I had begun to convert these scripts to R as it became apparent to me that the R community has so much to offer for comprehensive time series analysis.


In a series of pages, this will guide users on the many means of analysis included with sHydrology.


  1. sHydrology – designed to analyse long term daily average stream flow data.
  2. shyMet – designed to analyse long term daily average climate data.
  3. sHdrograph – a general platform for time-series analysis, used specifically for groundwater monitoring.


The initial page that appears when opening a sHydrology page is the raw data. This is the most important page because off the bat, not only can one gain an appreciation for the period of record and the data quality, but the general character of the hydrograph can be inspected with a trained eye.

The side bar (to the left of the page) offers some information on the station, such as station name, catchment area (where available), period of record, data quality and simple statistics. Options provided below allow the user to superimpose observation flags for additional quality assessment.

This time-series is plotted using dygraphs for R, which offers a dynamic means of zooming, scrolling and inspecting the time series. (Double-click anywhere returns to the default view.)

Upon changing the dygraph pane, the flow duration curve, monthly discharge and side panel information are updated automatically. This feature allows the user to examine the flow regime within a specified time period and compare against the entire period of record.

Baseflow separation

A common request from the groundwater community is an estimate of baseflow computed using automated hydrograph separation techniques. Fourteen variants of hydrograph separation algorithms are applied. (sHydrology relies on the median of daily estimates from these 14 variants.)

Streamflow recession

Much analysis that can be made on a streamflow hydrograph would be the location’s recession coefficient $k$ in $ b_t=kb_{t-1} $. Here, $k$ is determined automatically for any temporal dataset.

Hydrograph disaggregation

This is a process of analysing a continuous time series signal to identify rising limbs, falling limbs and recession periods. From this, additional information can be backed-out of the continuos data set by discretizing the hydrograph into discrete volumes associated with each peak. This allows the user to compare these “event yields” to local precipitation monitoring stations and inspect the quality of the basin’s monitoring network.