Learn R Programming

grwat (version 0.0.4)

gr_plot_acf: 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)

Value

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

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.

Examples

Run this code
library(grwat)

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

# plot ACF
gr_plot_acf(spas, 0.65)

Run the code above in your browser using DataLab