calc_ar1 | R Documentation |
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
calc_ar1(x, yearType = "water", wyMonth = 10L, digits = 3)
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 |
calc_ar1 AR(1) correlation coefficient
x <- sampleData[c("date","discharge")]
calc_ar1(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.