calc_ar1: calc_ar1 correlation coefficient

View source: R/calc_ar1.R

calc_ar1R Documentation

calc_ar1 correlation coefficient

Description

Function to compute the AR(1) correlation coefficient for a given timeseries of discharge

This function accepts a data frame containing daily streamflow data and returns the AR(1) correlation coefficient

Usage

calc_ar1(x, yearType = "water", wyMonth = 10L, digits = 3)

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 character 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.

digits

A numeric. Number of digits to round indice values

Value

calc_ar1 AR(1) correlation coefficient

Examples

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

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