gr_plot_acf: Plot runoff ACF

View source: R/plot.R

gr_plot_acfR Documentation

Plot runoff ACF

Description

The function plots the autocorrelation function (ACF) for daily runoff time series. A number of days corresponding to the specified autocorr value is highlighted.

Usage

gr_plot_acf(hdata, autocorr = 0.7, maxlag = 30, print = TRUE)

Arguments

hdata

data.frame with first column as Date and the second column as runoff

autocorr

Numeric value of the autocorrelation for which the time period will be highlighted. Defaults to 0.7.

maxlag

Integer value of the maximum daily lag used to calculate the correlation. Defaults to 30.

print

Boolean. Print plot? Defaults to TRUE. Use FALSE if you want to tweak the plot aesthetics before plotting.

Value

ggplot2 object representing the autocorrelation function (ACF) for daily runoff time series

Examples

library(grwat)

# example Spas-Zagorye data is included with grwat package
data(spas)
head(spas)

# plot ACF
gr_plot_acf(spas, 0.65)

grwat documentation built on Nov. 2, 2023, 5:21 p.m.