This function creates an interactive plot using dygraphs package

event_plot(
  dataframe,
  q,
  datetime,
  he,
  ssc,
  ylabel = "Water discharge",
  y2label = "Suspended Sediment Concentration"
)

Arguments

dataframe

A data set object

q

Water discharge variable (or water stage)

datetime

Datetime variable (column in POSIXct format)

he

Hydrological event variable (or other day column)

ssc

Suspended sediment concentration variable (to plot on a second axis)

ylabel

Y-axis label

y2label

Second Y-axis label

Value

The `event_plot` function returns object of class "dygraphs", "htmlwidget"

Examples

library(dplyr)
data(djan)
djan %>%
  hydro_events(
    q = discharge,
    datetime = time,
    window = 21
  ) %>%
  event_plot(q = SS, datetime = time, he = he)
#> Warning: Can't use data time zone: no 'tzone' attribute in data