CSHShydRology
This is a collection of R functions used by the Canadian Association Society for Hydrological Sciences.
https://github.com/CSHS-CWRA/CSHShydRology
Category: Natural Resources
Sub Category: Water Supply and Quality
Keywords from Contributors
hydrology
Last synced: about 12 hours ago
JSON representation
Repository metadata
Main package
- Host: GitHub
- URL: https://github.com/CSHS-CWRA/CSHShydRology
- Owner: CSHS-CWRA
- License: agpl-3.0
- Created: 2017-10-11T02:50:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-17T02:41:35.000Z (9 months ago)
- Last Synced: 2025-04-20T06:11:17.997Z (8 days ago)
- Language: HTML
- Homepage:
- Size: 6.68 MB
- Stars: 35
- Watchers: 17
- Forks: 39
- Open Issues: 6
- Releases: 2
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
README.md
CSHShydRology
Installing this package
The package may be downloaded directly from CRAN with:
install.packages("CSHShydRology")
Previous versions of the package and manuals can be found by clicking on releases. The latest version of the package may also be installed directly from this repository. The procedure is
- Install the package "devtools" - you only have to do this once. Note that this will also install several dependancies
- Load the devtools library
- Install the package.
The commands are:
if (!require(devtools)) install.packages("devtools")
library(devtools)
install_github("CSHS-CWRA/CSHShydRology")
What is CSHS Hydrology?
This is an R package of functions used by Canadian hydrologists. The name is in recognition of the support provided by the Canadian Association Society for Hydrological Sciences (CSHS) which is an affiliated society of the Canadian Water Resources Association (CWRA). The CSHS website is https://cwra.org/en/affiliates-programs/cshs/.
Themes
This package contains functions which are grouped into themes. Currently the themes include:
- Statistical hydrology (trend detection, data screening, frequency analysis, regionalization),
- Basic data manipulations (input/conversion/adapter functions, missing data infilling),
- Visualization (data visualization, standardized plotting functions),
- Spatial hydrology (basin delineation, landscape data analysis, working with GIS),
- Streamflow measurement analysis (rating curve analysis, velocity profiles, naturalization).
Other themes, such as Network design/analysis (homogeneity assessment), and Ecohydrology (fisheries and ecological analysis) will also be added if there is interest.
Coding standards
General standards
The general coding standards are as specified in the Google R coding guide at https://google.github.io/styleguide/Rguide.xml.
External packages
To reduce errors, it is a good idea to reduce reliance on other packages as much as is possible. Please check through the functions already referenced in the DESCRIPTION file before adding additional functions. When it is necessary to add a reference to an additional package, please do the following:
Make the package suggested, rather than required.
Make a note in the function’s Roxygen documentation that the function uses the package.
Make sure that the version number of the package is referenced properly.
When more than one function requires a given package, it can be made a required packages.
Devtools
To make package development easier, we will use the package devtools, which provides several tools. This package is explained at https://github.com/hadley/devtools.
Checking
The devtools check function will be used check each function for errors in syntax and style. Each function must pass the checks with zero warnings, errors or notes. Note that once you have loaded devtools, the check function can be accessed from a menu or from the build tab in Rstudio. It is also a good idea to manually run the check function from the command line, i.e.
R CMD check
as this can catch other problems.
Documentation
All functions need to be documented using the Roxygen package, which allows you to create the help files and documentation using comments in your function. The package is explained at https://cran.r-project.org/web/packages/roxygen2/vignettes/roxygen2.html. Rstudio has a very nice quick reference for Roxygen which you can access with Help|Roxygen Quick Reference.
Each function must include the name of the authors(s). Please include your email address, and any publications that you want to reference.
Note that the package itself also has a function. This contains documentation about the package as a whole, as well as settings which are used to create the package NAMESPACE file. Note that this means that the NAMESPACE file should never be edited directly by anyone.
When the package is compiled and tested, Roxygen will create a .Rd file for each function, the package, and for the included data files. These files should never be edited manually. If you want to check how your .Rd file will look, you can load it into Rstudio, which can render it.
Vignettes
Vignettes are long form documentation which can be included in R packages. They can include long descriptions and worked examples, and are very useful to thoroughly explain functions to the users. The creation process is explained at http://r-pkgs.had.co.nz/vignettes.html. Even if you don’t write code, you can contribute to writing vignettes for functions.
Testing
The testthat package allows unit tests to be created for each function. The function is executed, using specified data, and the results are compared to specified values. Unit tests should be used whenever possible, as they will identify problems caused by changes in upstream packages. The testthat package is explained in detail in http://r-pkgs.had.co.nz/tests.html.
Test data
Each function is required to have an example, which should be executable code. The only exception should be for code which is intended to access data which may not be available, such as data downloaded from a server.
The example, vignettes, and unit tests will all require test data sets. The data are stored in the /data folder of the package, and should be stored as .Rdata (binary) files, unless reading in data from another format is the point of the function. CRAN has a maximum limit of 1 MB for test data, so we will need to minimise the datasets we include. We should minimise the size of each test dataset and re-use the same data in as many functions as possible. If a function requires data output by another function, both functions can be included in the example.
Each dataset needs to be documented in the same way as a function. The creation of datasets and their documentation is explained at http://r-pkgs.had.co.nz/data.html.
Working with GitHub
There is a lot of information available on using git and GitHub in R. The best starting point is https://support.rstudio.com/hc/en-us/articles/200532077-Version-Control-with-Git-and-SVN which shows how to integrate git and GitHub with RStudio.
Citation
The package citation may be generated with the following command in R.
citation("CSHShydRology")
Owner metadata
- Name: Canadian Society for Hydrological Sciences
- Login: CSHS-CWRA
- Email: [email protected]
- Kind: organization
- Description:
- Website: https://cwra.org/en/branches/affiliates/cshs-a
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/38532892?v=4
- Repositories: 3
- Last ynced at: 2023-02-28T03:31:02.223Z
- Profile URL: https://github.com/CSHS-CWRA
GitHub Events
Total
- Watch event: 1
- Pull request event: 1
Last Year
- Watch event: 1
- Pull request event: 1
Committers metadata
Last synced: 6 days ago
Total Commits: 285
Total Committers: 6
Avg Commits per committer: 47.5
Development Distribution Score (DDS): 0.305
Commits in past year: 7
Committers in past year: 2
Avg Commits per committer in past year: 3.5
Development Distribution Score (DDS) in past year: 0.429
Name | Commits | |
---|---|---|
Kevin Shook | k****k@u****a | 198 |
PaulWhitfield | p****d@g****m | 45 |
rchlumsk | r****k@u****a | 25 |
boshek | s****s@g****m | 10 |
Victor Muñoz S | v****s@g****m | 4 |
Kevin Shook | k****k@k****a | 3 |
Committer domains:
- kshook.ca: 1
- uwaterloo.ca: 1
- usask.ca: 1
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 19
Total pull requests: 84
Average time to close issues: 5 months
Average time to close pull requests: about 1 month
Total issue authors: 5
Total pull request authors: 10
Average comments per issue: 1.79
Average comments per pull request: 0.76
Merged pull request: 60
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: about 10 hours
Past year issue authors: 0
Past year pull request authors: 2
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- KevinShook (14)
- rchlumsk (2)
- Jhydromet (1)
- rywhale (1)
- EAkomeah (1)
Top Pull Request Authors
- KevinShook (36)
- rchlumsk (22)
- PaulWhitfield (15)
- MIsmlAhmed (3)
- jwtrubil (2)
- boshek (2)
- vmunozs-zz (1)
- floodnetProject16 (1)
- vincenzocoia (1)
- JasonChiangIB (1)
Top Issue Labels
- bug (3)
Top Pull Request Labels
Dependencies
- R >= 4.0.0 depends
- Kendall * imports
- datasets * imports
- dplyr * imports
- fields * imports
- ggplot2 * imports
- ggspatial * imports
- here * imports
- httr * imports
- lubridate * imports
- magrittr * imports
- plotrix * imports
- raster * imports
- sf * imports
- stats * imports
- stringr * imports
- tidyhydat * imports
- timeDate * imports
- whitebox * imports
- knitr * suggests
- readr * suggests
- rmarkdown * suggests
- testthat * suggests
Score: 5.505331535932363