An open API service indexing awesome lists of open source software.

https://github.com/atsyplenkov/loadflux

An R package for river suspended sediment dynamics study.
https://github.com/atsyplenkov/loadflux

r r-package rstats

Last synced: 6 months ago
JSON representation

An R package for river suspended sediment dynamics study.

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# loadflux

[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/loadflux)](https://cran.r-project.org/package=loadflux)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6992087.svg)](https://doi.org/10.5281/zenodo.6992087)
[![](http://cranlogs.r-pkg.org/badges/grand-total/loadflux)](https://cran.r-project.org/package=loadflux)
[![codecov](https://codecov.io/gh/atsyplenkov/loadflux/branch/master/graph/badge.svg?token=DI1DCJV15D)](https://app.codecov.io/gh/atsyplenkov/loadflux/)
[![R-CMD-check](https://github.com/atsyplenkov/loadflux/workflows/R-CMD-check/badge.svg)](https://github.com/atsyplenkov/loadflux/actions/)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active/)

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](https://github.com/atsyplenkov/loadflux/) with:

``` r
# 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:

```{r example, message=FALSE, warning=FALSE}
library(dplyr)
library(loadflux)
data(djan)

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

head(df)
```

### Plots

Then you can plot the hysteresis loop by running `hysteresis_plot`

```{r hysteresis_plot, message=FALSE, warning=FALSE, out.width = "50%", fig.align='center'}
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**

- `SHI` - Simple Hystersis Index from [*Tsyplenkov et al., 2020*](https://link.springer.com/article/10.1007/s11368-020-02633-z/)
- `AHI` - Aich's Hysteresis Index from [*Aich et al., 2014*](https://www.sciencedirect.com/science/article/abs/pii/S0341816214001969/)

**Pending**

- `HImid` - Hysteresis Index from [*Lawler et al., 2006*](https://www.sciencedirect.com/science/article/abs/pii/S0048969705005711/)

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

```{r shi, message=FALSE, warning=FALSE}

df %>%
filter(he == 2) %>%
SHI(q = discharge,
ssc = SS)

```

### ACKNOWLEDGEMENTS
_This package was developed in accordance to the Development program of the Interdisciplinary Scientific and Educational School of M.V. Lomonosov Moscow State University "Future Planet and Global Environmental Change"_