get_seasonality: Function to compute the seasonal factors (amplitude and...

View source: R/get_seasonality.R

get_seasonalityR Documentation

Function to compute the seasonal factors (amplitude and phase) for a given data series

Description

This function accepts a data frame containing daily streamflow data, then computes get_seasonality variables by first standardizing flows, the fitting relation A*cos(2*pi*t) + B*sin(2*pi*t)1) Get decimal yearand returns the amplitude and phase

Usage

get_seasonality(x, yearType = "water", wyMonth = 10L)

Arguments

x

A dataframe containing a vector of date values in the first column and vector of numeric flow values in the second column.

yearType

A charcter of either "water" or "calendar" indicating whether to use water years or calendar years, respectively.

wyMonth

A numeric. The month of the year in which the water year starts (1=January, 12=December). The water year begins on the first day of wyMonth.

Value

get_seasonality vector of seasonal factors (amplitude and phase)

Examples

x <- sampleData[c("date","discharge")]
get_seasonality(x=x)

USGS-R/EflowStats documentation built on Sept. 30, 2023, 9:31 p.m.