Skip to content

Commit a64de74

Browse files
committed
docs: readme and news update
1 parent 06425d8 commit a64de74

7 files changed

Lines changed: 81 additions & 29 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ docs
1515
*.o
1616
*.so
1717
src/tidyhydro.dll
18+
tidyhydro.md

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: tidyhydro
22
Type: Package
33
Title: Tidy Metrics for Assessing Hydrological Models Performance
4-
Version: 0.1.1.9000
4+
Version: 0.1.2
55
Authors@R:
66
person(given = "Anatoly", family = "Tsyplenkov", email = "atsyplenkov@fastmail.com", role = c("cre", "aut", "cph"), comment = c(ORCID = "0000-0003-4144-8402"))
77
Maintainer: Anatoly Tsyplenkov <atsyplenkov@fastmail.com>
8-
Description: Provides tidy tools for comparing simulated and observed hydrological time series. Includes compatibility with the 'yardstick' package for model performance evaluation using commonly used metrics such as the Nash–Sutcliffe Efficiency (NSE), Kling–Gupta Efficiency (KGE), percent bias (pBIAS) and etc.
8+
Description: Provides tidy tools to measure the characteristics of hydrological time series and to assess the performance of hydrological models. Includes compatibility with the 'yardstick' package for model performance evaluation using commonly used metrics such as the Nash–Sutcliffe Efficiency (NSE), Kling–Gupta Efficiency (KGE), percent bias (pBIAS) and etc. Additionally provides a set of measures to calculate the descriptive statistics of a single dataset in accordance with Helsel et al. (2020). Helsel DR, Hirsch RM, Ryberg KR, Archfield SA, Gilroy EJ. Statistical methods in water resources. Reston, VA: 2020. <https://doi.org/10.3133/tm4A3>.
99
License: MIT + file LICENSE
1010
Depends: R (>= 4.1.0)
1111
Imports:

NEWS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# tidyhydro (development version)
1+
# tidyhydro 0.1.2
22

33
## New features
4-
- Added RMSE
4+
- Added RMSE (`rmse`) and log-transformed KGE (`kgelog`, `kgelog_low` and `kgelog_hi`)
5+
- Introduced descriptive statistics class — `measure`
6+
- Added `cv`, `gm` measures
57

68
## Miscellaneous
79

README.Rmd

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ requireNamespace("bench", quietly = TRUE)
3535

3636
The `tidyhydro` package provides a set of commonly used metrics in hydrology (such as _NSE_, _KGE_, _pBIAS_) for use within a [`tidymodels`](https://www.tidymodels.org/) infrastructure. Originally inspired by the [`yardstick`](https://github.com/tidymodels/yardstick/tree/main) and [`hydroGOF`](https://github.com/hzambran/hydroGOF) packages, this library is mainly written in C++ and provides a very quick estimation of desired goodness-of-fit criteria.
3737

38-
Additionally, you'll find here a C++ implementation of lesser-known yet powerful metrics and coefficients recommended in the United States Geological Survey (USGS) and the National Environmental Monitoring Standards (NEMS) guidelines. Examples include _PRESS_ (Prediction Error Sum of Squares), _SFE_ (Standard Factorial Error), _MSPE_ (Model Standard Percentage Error) and others. Based on the equations from _Helsel et al._ ([2020](https://pubs.usgs.gov/publication/tm4A3)), _Rasmunsen et al._ ([2008](https://pubs.usgs.gov/tm/tm3c4/)), _Hicks et al._ ([2020](https://www.nems.org.nz/documents/suspended-sediment)) and etc. (see documentation for details).
38+
Additionally, you'll find here a C++ implementation of lesser-known yet powerful metrics and descriptive statistics recommended in the United States Geological Survey (USGS) and the National Environmental Monitoring Standards (NEMS) guidelines. Examples include _PRESS_ (Prediction Error Sum of Squares), _SFE_ (Standard Factorial Error), _MSPE_ (Model Standard Percentage Error) and others. Based on the equations from _Helsel et al._ ([2020](https://pubs.usgs.gov/publication/tm4A3)), _Rasmunsen et al._ ([2008](https://pubs.usgs.gov/tm/tm3c4/)), _Hicks et al._ ([2020](https://www.nems.org.nz/documents/suspended-sediment)) and etc. (see documentation for details).
3939

40-
## Example
40+
## Performance metrics
4141
The `tidyhydro` package follows the philosophy of [`yardstick`](https://github.com/tidymodels/yardstick/tree/main) and provides S3 class methods for vectors and data frames. For example, one can estimate `KGE`, `NSE` or `pBIAS` for a data frame like this:
4242

4343
```{r example}
@@ -61,6 +61,17 @@ We do understand that sometimes one needs a qualitative interpretation of the mo
6161
hydro_metrics(avacha, obs, sim, performance = TRUE)
6262
```
6363

64+
## Descriptive statistics
65+
In addition to `metric`, inherited from `yardstick`, the `tidyhydro` introduces the `measure` objects. It aims to calculate descriptive statistics of a single dataset, such as `cv()` — coefficient of variation (a measure of variability) or `gm()` — geometric mean (a measure of central tendency):
66+
67+
```{r measureset}
68+
# Coefficient of Variation
69+
cv(avacha, obs)
70+
71+
# Geometric mean
72+
gm_vec(avacha$obs)
73+
```
74+
6475
## Installation
6576

6677
You can install the development version of `tidyhydro` from [GitHub](https://github.com/atsyplenkov/tidyhydro) with:

README.md

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
# tidyhydro
55

66
<!-- badges: start -->
7+
78
<p align="center">
9+
810
<a href="https://github.com/atsyplenkov/tidyhydro/releases">
911
<img src="https://img.shields.io/github/v/release/atsyplenkov/tidyhydro?style=flat&labelColor=1C2C2E&color=198ce7&logo=GitHub&logoColor=white"></a>
1012
<!-- <a href="https://cran.r-project.org/package=tidyhydro">
@@ -14,6 +16,7 @@
1416
<a href="https://github.com/atsyplenkov/tidyhydro/actions/workflows/check-r-pkg.yaml">
1517
<img src="https://img.shields.io/github/actions/workflow/status/atsyplenkov/tidyhydro/check-r-pkg.yaml?style=flat&labelColor=1C2C2E&color=256bc0&logo=GitHub%20Actions&logoColor=white"></a>
1618
</p>
19+
1720
<!-- badges: end -->
1821

1922
The `tidyhydro` package provides a set of commonly used metrics in
@@ -26,17 +29,18 @@ library is mainly written in C++ and provides a very quick estimation of
2629
desired goodness-of-fit criteria.
2730

2831
Additionally, you’ll find here a C++ implementation of lesser-known yet
29-
powerful metrics and coefficients recommended in the United States
30-
Geological Survey (USGS) and the National Environmental Monitoring
31-
Standards (NEMS) guidelines. Examples include *PRESS* (Prediction Error
32-
Sum of Squares), *SFE* (Standard Factorial Error), *MSPE* (Model
33-
Standard Percentage Error) and others. Based on the equations from
34-
*Helsel et al.* ([2020](https://pubs.usgs.gov/publication/tm4A3)),
35-
*Rasmunsen et al.* ([2008](https://pubs.usgs.gov/tm/tm3c4/)), *Hicks et
36-
al.* ([2020](https://www.nems.org.nz/documents/suspended-sediment)) and
37-
etc. (see documentation for details).
38-
39-
## Example
32+
powerful metrics and descriptive statistics recommended in the United
33+
States Geological Survey (USGS) and the National Environmental
34+
Monitoring Standards (NEMS) guidelines. Examples include *PRESS*
35+
(Prediction Error Sum of Squares), *SFE* (Standard Factorial Error),
36+
*MSPE* (Model Standard Percentage Error) and others. Based on the
37+
equations from *Helsel et al.*
38+
([2020](https://pubs.usgs.gov/publication/tm4A3)), *Rasmunsen et al.*
39+
([2008](https://pubs.usgs.gov/tm/tm3c4/)), *Hicks et al.*
40+
([2020](https://www.nems.org.nz/documents/suspended-sediment)) and etc.
41+
(see documentation for details).
42+
43+
## Performance metrics
4044

4145
The `tidyhydro` package follows the philosophy of
4246
[`yardstick`](https://github.com/tidymodels/yardstick/tree/main) and
@@ -88,6 +92,27 @@ hydro_metrics(avacha, obs, sim, performance = TRUE)
8892
#> 2 pbias standard Excellent
8993
```
9094

95+
## Descriptive statistics
96+
97+
In addition to `metric`, inherited from `yardstick`, the `tidyhydro`
98+
introduces the `measure` objects. It aims to calculate descriptive
99+
statistics of a single dataset, such as `cv()` — coefficient of
100+
variation (a measure of variability) or `gm()` — geometric mean (a
101+
measure of central tendency):
102+
103+
``` r
104+
# Coefficient of Variation
105+
cv(avacha, obs)
106+
#> # A tibble: 1 × 3
107+
#> .metric .estimator .estimate
108+
#> <chr> <chr> <dbl>
109+
#> 1 cv standard 0.533
110+
111+
# Geometric mean
112+
gm_vec(avacha$obs)
113+
#> [1] 128.9476
114+
```
115+
91116
## Installation
92117

93118
You can install the development version of `tidyhydro` from
@@ -128,9 +153,9 @@ bench::mark(
128153
#> # A tibble: 3 × 6
129154
#> expression min median `itr/sec` mem_alloc `gc/sec`
130155
#> <bch:expr> <dbl> <dbl> <dbl> <dbl> <dbl>
131-
#> 1 tidyhydro 1 1 28.7 NaN NaN
132-
#> 2 hydroGOF 14.5 18.6 1 Inf Inf
133-
#> 3 baseR 8.35 10.0 2.42 Inf Inf
156+
#> 1 tidyhydro 1 1 13.3 NaN NaN
157+
#> 2 hydroGOF 9.69 8.63 1 Inf Inf
158+
#> 3 baseR 5.80 5.54 2.27 Inf Inf
134159
```
135160

136161
## Code of Conduct
@@ -142,8 +167,8 @@ By contributing to this project, you agree to abide by its terms.
142167

143168
## See also
144169

145-
- [`hydroGOF`](https://github.com/hzambran/hydroGOF) - Goodness-of-fit
146-
functions for comparison of simulated and observed hydrological time
147-
series.
148-
- [`yardstick`](https://github.com/tidymodels/yardstick/tree/main) -
149-
tidy methods for models performance assessment.
170+
- [`hydroGOF`](https://github.com/hzambran/hydroGOF) - Goodness-of-fit
171+
functions for comparison of simulated and observed hydrological time
172+
series.
173+
- [`yardstick`](https://github.com/tidymodels/yardstick/tree/main) -
174+
tidy methods for models performance assessment.

codemeta.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"codeRepository": "https://github.com/atsyplenkov/tidyhydro",
99
"issueTracker": "https://github.com/atsyplenkov/tidyhydro/issues",
1010
"license": "https://spdx.org/licenses/MIT",
11-
"version": "0.1.1.9000",
11+
"version": "0.1.2",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",
1515
"url": "https://r-project.org"
1616
},
17-
"runtimePlatform": "R version 4.5.1 Patched (2025-06-14 r88315)",
17+
"runtimePlatform": "R version 4.5.1 Patched (2025-06-20 r88332 ucrt)",
1818
"author": [
1919
{
2020
"@type": "Person",
@@ -128,9 +128,22 @@
128128
},
129129
"sameAs": "https://CRAN.R-project.org/package=yardstick"
130130
},
131+
"5": {
132+
"@type": "SoftwareApplication",
133+
"identifier": "checkmate",
134+
"name": "checkmate",
135+
"version": ">= 2.3.1",
136+
"provider": {
137+
"@id": "https://cran.r-project.org",
138+
"@type": "Organization",
139+
"name": "Comprehensive R Archive Network (CRAN)",
140+
"url": "https://cran.r-project.org"
141+
},
142+
"sameAs": "https://CRAN.R-project.org/package=checkmate"
143+
},
131144
"SystemRequirements": null
132145
},
133-
"fileSize": "7277.498KB",
146+
"fileSize": "7300.242KB",
134147
"releaseNotes": "https://github.com/atsyplenkov/tidyhydro/blob/master/NEWS.md",
135148
"readme": "https://github.com/atsyplenkov/tidyhydro/blob/master/README.md",
136149
"keywords": ["r", "r-package", "rstats"]

man/tidyhydro-package.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)