Learn R Programming

loadflux

The loadflux package is build for the comprehensive analysis of the intra-event suspended sediment dynamics.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("atsyplenkov/loadflux")

Example

This is a basic example which shows you how to split your series into hydrological events:

library(dplyr)
library(loadflux)
data(djan)

df <- djan %>% 
  hydro_events(q = discharge,
               datetime = time,
               window = 21)

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

Plots

Then you can plot the hysteresis loop by running hysteresis_plot

library(ggplot2)

df %>% 
  filter(he == 2) %>%
  hysteresis_plot(q = discharge,
                  ssc = SS,
                  base_font_size = 14)

Hyseteresis indexes

This package also contains several function for hysteresis index calculation:

Added

Pending

To calculate a hysteresis index for your event run as follows:

df %>% 
  filter(he == 2) %>% 
  SHI(q = discharge,
      ssc = SS)
#> [1] 0.2473604

Copy Link

Version

Install

install.packages('loadflux')

Monthly Downloads

53

Version

0.0.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Anatoly Tsyplenkov

Last Published

November 5th, 2021

Functions in loadflux (0.0.2)

AHI

Calculate Aich's Hysteresis Index
djan

Djankuat river water discharge and suspended sediment concentration measurements
loadflux-features

Calculate features of a `tsibble` object in conjunction with [features()]
hysteresis_plot

Plot Q-SSC hysteresis plot
djanturb

Djankuat river turbidity logger measurements
event_plot

Visualize hydrological events interactively
SHI

Calculate Simple Hysteresis Index (SHI)
hydro_events

Splitting to hydrological events
TI

Calculate Turbidity Index (TI)