-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
103 lines (72 loc) · 3.18 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# loadflux <img src='man/figures/logo.svg' align="right" height="139" />
<!-- badges: start -->
[![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/)
<!-- badges: end -->
The `loadflux` package is build for the comprehensive analysis of the intra-event suspended sediment dynamics.
## Installation
<!-- CRAN
You can install the released version of loadflux from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("loadflux")
```
-->
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"_