Learn R Programming

grwat

Welcome to grwat, an R package for the automatic hydrograph separation and daily hydrological time series analysis. grwat provides various filters to separate baseflow and quickflow. Implements advanced separation technique which involves meteorological data to reveal genetic components of the runoff: ground, rain, thaw and spring (seasonal thaw). High-performance C++17 computation, annually aggregated variables, statistical testing and numerous ggplot-based functions for informative plotting.

Important note: The current state of the package should be considered experimental. Convenience of grwat data model and processing workflow should be tested by package users and may change in near future. Feel free to submit bugs and suggestions on improvement of the package to the GitHub issues.

Install released version from CRAN

Install the latest released version of grwat from CRAN by:

install.packages("grwat")

Install development version from R-universe

The current development version of grwat can be installed from R-universe:

# Enable repository from tsamsonov
options(
  repos = c(
    ropensci = 'https://tsamsonov.r-universe.dev',
    CRAN = 'https://cloud.r-project.org'
  )
)
  
# Download and install grwat in R
install.packages('grwat')

Install development version from GitHub

The current development version of grwat can be installed from GitHub. For this three steps are required:

  1. Install remotes R package
  2. Install compiler (Windows and macOS only)
  3. Install grwat R package

Install remotes

To install from GitHub, you should install remotes package first (unless it is already installed on your machine):

install.packages("remotes")

Install compiler

Since grwat contains C++ code, it needs to be compiled during the package installation.

Linux users should have the compiler already installed in their system.

macOS users have to:

  1. Install Xcode command-line tools.
  2. Restart R session.

Windows users have to:

  1. Install Rtools.
  2. Restart R session.

Install grwat

If all previous steps are completed successfully, grwat package can be installed via single command:

remotes::install_github("tsamsonov/grwat")

A note to Windows users: if you get the error during installation over the previously installed grwat, remove the package folder manually, restart R and then hit remotes::install_github("tsamsonov/grwat", INSTALL_opts = '--no-lock'). You should run RStudio as Administrator to get the full access to the package installation folder. The location of installation folder can be learned from Packages — Install dialog or by .libPaths() command in R console as displayed below.

> .libPaths()
[1] "C:/Users/tsamsonov/Documents/R/win-library/4.1"
[2] "C:/Program Files/R/R-4.1.0/library" 

Why 'grwat'?

grwat is an acronym made from ground water. This name emerged historically because the extraction of the ground flow (baseflow) is one of the most important stages in the advanced separation algorithm provided by the package.

Funding

grwat package has been developed in 2019-2022 with financial support of Russian Science Foundation (RSF) Project 19-77-10032.

The main separation algorithm was developed in 2016-2018 with financial support of Russian Foundation for Basic Research (RFBR) Project 16-35-60080.

The mountain block of the main separation algorithm was developed in 2018-2019 with financial support of Russian Science Foundation (RSF) Project 17-77-10169.

Copy Link

Version

Install

install.packages('grwat')

Monthly Downloads

233

Version

0.0.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Timofey Samsonov

Last Published

October 27th, 2023

Functions in grwat (0.0.4)

gr_separate

Advanced hydrograph separation
gr_plot_periods

Plot long-term hydrograph variable changes
gr_set_locale

Set the language that is used for plotting
gr_read_rean

Read reanalysis data
gr_report

Report hydrograph separation and variables
spas

Spas-Zagorye daily runoff data
gr_test_vars

Test hydrograph changes
gr_plot_vars

Plot interannual hydrograph variable changes
gr_summarize

Summarize hydrograph separation
gr_set_param

Set the value of hydrograph separation parameter
gr_plot_acf

Plot runoff ACF
%>%

Pipe operator
gr_check_data

Check the correctness of data frame for separating
gr_check_params

Check the correctness of parameters list for separating
gr_fill_gaps

Fill missing daily data
gr_get_gaps

Get gaps in the daily data
gr_get_params

Get hydrograph separation parameters
gr_help_vars

Hydrograph separation variables
gr_help_params

Get the information about parameters used to separate the hydrograph
gr_buffer_geo

Quasi-geographic buffering
gr_join_rean

Join reanalysis data
gr_baseflow

Extract baseflow
gr_plot_hori

Horizon hydrograph plot
gr_plot_ridge

Ridgeline hydrograph plot
gr_plot_tests

Plot change year density
gr_kable_tests

Tabular representation of tests
gr_plot_sep

Plot hydrograph separation
gr_plot_minmonth

Plot minimum runoff month
gr_plot_matrix

Runoff matrix plot