runmean.iha: Calculate rolling means for group2 statistics

runmean.ihaR Documentation

Calculate rolling means for group2 statistics

Description

Calculate centered rolling means four group2 statsistics. Uses runmean from caTools to quickly get rolling averages for a time series.

Usage

runmean.iha(x, yearVector = NULL, mimic.tnc = F)

Arguments

x

a numeric vector

yearVector

a vector of years (calendar or water year identifiers; necessary for mimic.tnc = TRUE)

mimic.tnc

logical should the years be split before the running mean is calculated e.g. should running means for each year be calculated independently? If mimic.tnc is TRUE, then yearVector must be provided and running means will be calculated for each year of data without using data from the following or previous year

Details

If mimic.tnc is TRUE, it will calculate the running mean for each year independtly of the others (thereby not using data from the next or previous year), If mimic.tnc is TRUE, yearVector must be provided as a vector of the year for each entry in x. Rolling means are calculated as centered means, using data that occurs before and after a given day to compute the rolling mean

Value

a matrix with the rolling means of all the data combined into columns. Each column represents a different rolling average and is either the 1-day, 3-day, 7-day, 30-day, or 90-day average. NAs will be present at the start and end of each year if mimic.tnc = TRUE

Author(s)

jason.e.law@gmail.com (imported to Hydrotools by Connor Brogan,connor.brogan@deq.virginia.gov)


HARPgroup/hydro-tools documentation built on July 4, 2025, 11:05 a.m.