README.md

License lifecycle

grwat

Welcome to grwat, an R package for hydrograph separation and analysis based on water level, temperature and percipitation data. It makes use of geographic data processing to spatially select temperature and precipitation data within the basin of each gauge, average these data and join them to each element in water level series. High-preformance Fortran/C++ computation is used for hydrograph processing that separates water level series into ground, seasonal, thaw, and flood discharge. Interannual and long-term characteristics of each discharge type are derived. Results are visualized in a form of high-quality reports making use of ggplot2 graphics and knitr report generation

Installing

To use grwat on your machine you need to install:

  1. devtools package
  2. command-line development tools (Windows and macOS users only)
  3. grwat package itself
  4. TeX distribution (only if you need PDF reporting)

Install devtools package

devtools is a great library that facilitates working with in-development packages not hosted on CRAN. You have to install it first (unless it is already installed on your machine):

install.packages("devtools")

Install command-line development tools

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.
  3. Run the following code in R command line:
library(devtools)
assignInNamespace("version_info", c(devtools:::version_info, list("3.5" = list(version_min = "3.3.0", version_max = "99.99.99", path = "bin"))), "devtools")

Install grwat package

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

devtools::install_github("tsamsonov/grwat")

Install TeX distribution

One of the key features of grwat is reporting. Reports are generated in HTML by default. PDF reporting is also supported, but this requires installed TeX distribution. The easiest way to get TeX is to use tinytex package. It provides a small TeX distribution that installs LaTeX packages automatically as soon as they are needed.

The following commands will install tinytex package and TeX distribution underlying it:

install.packages('tinytex')
tinytex::install_tinytex()

Then restart R session and run tinytex:::is_tinytex(). If everything is OK, you will get TRUE as a result:

tinytex:::is_tinytex()
[1] TRUE

TeX is not required if you use report generation in HTML format. Currently only English locale is supported in PDF reports. Russian locale is unavailable due to unresolved TeX issues with Cyrillic symbols.

Using

Check out the Get started vignette at the top of the page.

Acknowledgments

The main separation algoritm grwat package was developed with financial support of RFBR (Project 16-35-60080).

The mountain block of the program was created with support of Russian Scientific Foundation (Project 17-77-10169).



tsamsonov/grwat documentation built on Jan. 11, 2020, 4:43 p.m.