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.
- Host: GitHub
- URL: https://github.com/atsyplenkov/loadflux
- Owner: atsyplenkov
- License: other
- Created: 2021-03-14T14:40:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-23T13:16:15.000Z (about 3 years ago)
- Last Synced: 2025-09-19T17:41:32.742Z (6 months ago)
- Topics: r, r-package, rstats
- Language: R
- Homepage: https://atsyplenkov.github.io/loadflux
- Size: 1.62 MB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
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 
[](https://cran.r-project.org/package=loadflux)
[](https://doi.org/10.5281/zenodo.6992087)
[](https://cran.r-project.org/package=loadflux)
[](https://app.codecov.io/gh/atsyplenkov/loadflux/)
[](https://github.com/atsyplenkov/loadflux/actions/)
[](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"_