This is a basic example which shows you how to split your series into hydrological events:
library(dplyr)
library(loadflux)
data(djan)
<- djan %>%
df hydro_events(q = discharge, # Water discharge
datetime = time, # POSISct argument
window = 21) # Search window
head(df)
#> # A tibble: 6 x 4
#> he time discharge SS
#> <dbl> <dttm> <dbl> <dbl>
#> 1 1 2017-06-06 12:00:00 0.778 227.
#> 2 1 2017-06-06 13:00:00 0.778 NA
#> 3 1 2017-06-06 14:00:00 0.778 224.
#> 4 1 2017-06-06 15:00:00 0.778 NA
#> 5 1 2017-06-06 16:00:00 0.778 271.
#> 6 1 2017-06-06 17:00:00 0.925 NA
Then you can explore visually hydrological events via event_plot
function. This function creates an interactive dygraph
object which is rendered as html
. Every coral stripe stands for one hydrological event.
library(dygraphs)
%>%
df event_plot(q = discharge, # Y-axis
datetime = time, #X-axis
he = he) # Hydrological events
You can even explore both Water Discharge Q
and Suspended Sedimnet Concentration SSC
temporal variability:
library(dygraphs)
%>%
df event_plot(q = discharge, # Y-axis
ssc = SS,
datetime = time, #X-axis
he = he) # Hydrological events