A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

droughtR

An R package for non-stationary meteorological drought monitoring.
https://github.com/mammask/droughtr

Category: Natural Resources
Sub Category: Soil and Land

Keywords

bias bias-correction forecasting hydrology time-series

Last synced: about 18 hours ago
JSON representation

Repository metadata

An R package for non-stationary meteorological drought monitoring

README.Rmd

          ---
title: "droughtR"
link-citations: true
bibliography: references.bib
output: github_document
---

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


[![DOI](https://zenodo.org/badge/398032827.svg)](https://zenodo.org/doi/10.5281/zenodo.10009276)

[![codecov](https://codecov.io/gh/mammask/droughtR/graph/badge.svg?token=WYHK9P2NXP)](https://codecov.io/gh/mammask/droughtR)



The goal of `droughtR` is to enable meteorological drought monitoring by generating non-stationary drought indices under various distributional assumptions (Normal, Gamma, Zero Inflated Gamma and Weibull). It computes the stationary (SPI) and the non-stationary (NSPI) Standardized Precipitation Indices using General Additive Models for Location Scale and Shape (GAMLSS). 



```{r, echo = FALSE}
knitr::opts_chunk$set(
  fig.path = "README_figs/README-"
)
```

## Installation

```{r, eval=FALSE}
# Install the development version on Github
devtools::install_github("mammask/droughtR")
```

## Usage

### Generate SPI and NSPI

The function `computenspi` creates stationary and non-stationary meteorological drought indices at different time scales. By default, droughtR uses the gamma distribution:

```{r, eval=TRUE, fig.height=3, fig.width=9, fig.align='center'}
# Load droughtR library
library(droughtR)

# Generate synthetic monthly rainfall data using the Gamma distribution
rain = dummyrainfall(startYear = 1950, endYear = 2010)

# Compute the non-stationary standardized precipitation index (NSPI) for scale 12 using GAMLSS
nonstatdrought = computenspi(x = rain, stationaryspi = FALSE, spiScale = 12, dist = 'gamma')

# Plot NSPI
plot(nonstatdrought)
```

```{r, fig.height=3, fig.width=9, fig.align='center'}
# Compute the stationary standardized precipitation index (NSPI) for scale 12 using GAMLSS and the weibull distribution
statdrought = computenspi(x = rain, stationaryspi = TRUE, spiScale = 12, dist = 'weibull')

# Plot SPI 
plot(statdrought)
```










































































































        

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 6 days ago

Total Commits: 49
Total Committers: 2
Avg Commits per committer: 24.5
Development Distribution Score (DDS): 0.449

Commits in past year: 26
Committers in past year: 1
Avg Commits per committer in past year: 26.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Mammas k****s@i****m 27
Kostas Mammas m****k@l****m 22

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 0
Total pull requests: 0
Average time to close issues: N/A
Average time to close pull requests: N/A
Total issue authors: 0
Total pull request authors: 0
Average comments per issue: 0
Average comments per pull request: 0
Merged pull request: 0
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/mammask/droughtr

Top Issue Authors

Top Pull Request Authors


Top Issue Labels

Top Pull Request Labels


Dependencies

DESCRIPTION cran
  • SPEI * imports
  • data.table * imports
  • forecast * imports
  • gamlss * imports
  • gamlss.dist * imports
  • ggplot2 * imports
  • stats * imports
  • zoo * imports
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 3.0.0 suggests
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite

Score: 2.890371757896165