rvn_annual_peak_event: Annual Peak Event Comparison

rvn_annual_peak_eventR Documentation

Annual Peak Event Comparison

Description

rvn_annual_peak_event creates a plot of the annual observed and simulated peaks, based on the water year.

Usage

rvn_annual_peak_event(
  sim,
  obs,
  mm = 9,
  dd = 30,
  add_line = TRUE,
  add_r2 = FALSE,
  add_eqn = FALSE
)

Arguments

sim

time series object of simulated flows

obs

time series object of observed flows

mm

month of water year (default 9)

dd

day of water year (default 30)

add_line

optionally adds a 1:1 line to the plot for reference (default TRUE)

add_r2

optionally computes the R2 and adds to plot (default FALSE)

add_eqn

optionally adds the equation for a linear regression line through the origin (default FALSE)

Details

Creates a scatterplot of the annual observed and simulated peaks, calculated for each available water year of data within the two series provided; note that the difference between this and the annual.peak function is that here the peak event simulated for the same day as the peak event in observed data is used, instead of the largest recorded simulated event. In some sense this captures the timing of the event, i.e. the peak event must be simulated on the same day as the observed peak to be captured well.

The sim and obs should be of time series (xts) format and are assumed to be of the same length and time period. The flow series are assumed to be daily flows with units of m3/s.

The R2 diagnostic is calculated for a fit with no intercept (in a perfect fit the points are identical, and intercept is automatically zero).

Note that a plot title is purposely omitted in order to allow the automatic generation of plot titles.

Value

returns a list with peak data in a data frame, and a ggplot object

df_peak_event

data frame of the calculated peak events

p1

ggplot object with plotted annual peaks

See Also

rvn_annual_peak to create a scatterplot of annual peaks (consider the magnitude of peaks only)

Examples


# load sample hydrograph data, two years worth of sim/obs
data(rvn_hydrograph_data)
sim <- rvn_hydrograph_data$hyd$Sub36
obs <- rvn_hydrograph_data$hyd$Sub36_obs

# create a plot of annual peak events with default options
peak1 <- rvn_annual_peak_event(sim, obs)
peak1$df_peak_event
peak1$p1


rchlumsk/RavenR documentation built on April 19, 2024, 5:15 a.m.