Category Archives: R-bloggers

Script to analyse hourly flow data

I’m often doing similar types analyses with flow data from the Victorian government data warehouse.  This post outlines a script to process hourly data, return a summary of annual flows and produce some plots.  The script is available as a gist and can be extended to cater for specific tasks.

I’ll use Joyces Creek @ Strathlea has an example (407230).  Go to to a specific site on the data warehouse, use a URL like:

Hourly data can be download from the screen shown in Figure 1


Figure 1: Download hourly stream discharge

Data needs to be downloaded and stored on your computer, then set the correct path and filename in the script.  The script will produce an annual summary including the maximum flow in each year and when it occurred, the number of days when flows were recorded and the number of missing values.


Figure 2: View of summary data frame – annual data for Joyces Creek

Plot of annual peak flows.


Figure 3: Joyces Creek, annual peak flows

Time of the year when floods occurred.   The largest 5 floods are labelled. Note the very large flood in Jan 2011.


Figure 4: Time of the year when floods occurred