Hydrologic Indices for Daily Time Series Data

Calculates a suite of hydrologic indices for daily time series data that are widely used in hydrology and stream ecology.

hydrostats is a set of tools to compute streamflow indices commonly used in hydrology and ecology such as:

  • basic summary statistics
  • high spells (magnitude, frequency, duration, timing etc.)
  • low spells
  • cease-to-flow spells
  • Colwell's indices
  • partial series
  • baseflow components

Most of the functions can be used with the packages plyr and dplyr to return a dataframe of indices based on an additional grouping variable. This allows the analysis (for example) of data from multiple gauges simultaneously, without the need to write a for loop. While most functions return a single row dataframe, several functions will instead return a dataframe of individual spell charactersistics for use in subsequent analysis and plotting.


To install the latest development version run the following code:

Current version on github and CRAN is 0.2.7.

# install dependencies/suggests:
# devtools required only to install from Github; 
# plyr required for examples
install.packages(c("devtools", "plyr"))

#install pacakge

# Remove the package zip after installation


Nick Bond [email protected]


hydrostats 0.2.7

BUG FIXES AND MINOR IMPROVEMENTS *Addressed codign issue that occassionally threw an error when using the CTF function with dplyr 'do' or purrr. Returned results unaffected.

hydrostats 0.2.6

BUG FIXES AND MINOR IMPROVEMENTS *Made a minor change to the baseflow function so that when the Lynn Hollick filter is used to estimate quickflow at each time step, any values < 0 are set to 0 immediately, before calculating the next quickflow value (Thanks to Leo-Juhani Meriö).

*Fixed a bug in the high.spell and low.spell functions, so that the SD of the timing of max and min annual flows, respectively, are still calculated in situations where the max/min value occurs on multiple days.

hydrostats 0.2.5

BUG FIXES AND MINOR IMPROVEMENTS *The high.spells function was fixed to correct an error in the calculation of summary statistics for peaks (mean and sd). Formerly these included all flows above the threshold. (Thanks to Scott Hardie for picking this up).

*The Colwells function was modified to use log base 2 for the entropy calculations. This value can now be set by the user. (Thanks to Benedikt Heudorfer for modifying the code to include this functionality).

*A typo was corrected in the monthly.cv function help file to allow the examples to run correctly. (Thanks to Sunny Yu).

*A low.spell.lengths function was added to provide the ability to calculate low spell start date and duration with the same flexibility as for high spells (including independence criteria). This extends the functionality of using high.spell.lengths with inter.flood=TRUE. (Thanks to Tim Haeusler).

hydrostats 0.2.4


  • The high.spell.lengths function was fixed so that missing values do not result in incorrect start dates being returned (Thanks to Bastian Pöschl).

  • Fixed a typo in the help for daily.cv (Thanks to Tony Ladson).

  • The baseflows function now reflects the start and end values from the time-series (n.reflected) before calculating the baseflow component to reduce sensitivity to the starting conditions (as recommended by Ladson, A. R., R. Brown, B. Neal and R. Nathan (2013). “A standard approach to baseflow separation using the Lyne and Hollick filter.” Australian Journal of Water Resources 17(1): 173-180.).

  • corrected year count in the baseflow function.

hydrostats 0.2.3


  • Modified a number of functions (including partial.series and baseflow) to prevent an error when used with group_by and 'do' from the dplyr package (useful for analysing multiple flow series simultaneously).

  • added minimum and median spell duration to the results returned by the low.spells and high.spells functions.

  • added number of years and ARI to the partial series output.

  • fixed an error in high.spells and low.spells, which could produce an error in the duration statistics for annual series.

hydrostats 0.2.2


  • Modified the code for high.spells and low.spells to prevent an error when used with the 'do' function in dplyr, which allows the use of arbitrary functions with the group_by function.

hydrostats 0.2.1


  • fixed a bug in baseflow function that caused issues when date and discharge data were in columns other than columns 1 and 2.

  • added to Colwells function the ability to output a dataframe of the indices only.

  • shifted the reporting of record length from high.spells to baseflows function so that if outputs are combined in a dataframe, record length is now the first variable if baseflows is the first function run.

  • various corrections/edits to the manual pages.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.2.8 by Nick Bond, 4 months ago


Browse source code at https://github.com/cran/hydrostats

Authors: Nick Bond

Documentation:   PDF Manual  

Task views: Hydrological Data and Modeling

GPL (>= 2) license

Imports stats, utils, graphics

Suggests dplyr, plyr

See at CRAN