tidywater
Incorporates published water chemistry and empirical models in a standard format to build custom, comprehensive drinking water treatment processes.
https://github.com/brownandcaldwell-public/tidywater
Category: Natural Resources
Sub Category: Water Supply and Quality
Keywords
chemistry drinking-water r-programming tidyverse water
Last synced: about 1 hour ago
JSON representation
Repository metadata
Tidywater incorporates published water chemistry and empirical models in a standard format. The modular functions allow for building custom, comprehensive drinking water treatment processes.
- Host: GitHub
- URL: https://github.com/brownandcaldwell-public/tidywater
- Owner: BrownandCaldwell-Public
- License: other
- Created: 2024-09-16T20:30:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-18T23:08:34.000Z (about 1 month ago)
- Last Synced: 2026-02-21T22:29:33.488Z (about 1 month ago)
- Topics: chemistry, drinking-water, r-programming, tidyverse, water
- Language: R
- Homepage: https://brownandcaldwell-public.github.io/tidywater/
- Size: 4.77 MB
- Stars: 18
- Watchers: 4
- Forks: 4
- Open Issues: 8
- Releases: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
- Governance: GOVERNANCE.md
- Copyright: COPYRIGHT.md
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# tidywater
[](https://github.com/BrownandCaldwell-Public/tidywater/actions/workflows/R-CMD-check.yaml)
[](https://github.com/BrownandCaldwell-Public/tidywater/tree/main?tab=License-2-ov-file#mit-license)
[](https://github.com/BrownandCaldwell-Public/tidywater/tree/main?tab=License-2-ov-file#mit-license)
## Overview
Tidywater incorporates published water chemistry and empirical models in a standard format.
The modular functions allow for building custom, comprehensive drinking water treatment processes.
Functions are designed to work in a [tidyverse](https://www.tidyverse.org/) workflow.
## Installation
``` r
# Install tidywater from CRAN:
install.packages("tidywater")
# Alternatively, install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("BrownandCaldwell-Public/tidywater")
```
## Examples
In this first example, acid-base chemistry and TOC removal models are demonstrated. This example
uses tidywater base functions to model a single water quality scenario.
```{r example, message = FALSE, setup = TRUE}
library(tidywater)
library(tidyverse)
## Use base tidywater functions to model water quality for a single scenario.
base_coagulation <- define_water(ph = 8, alk = 90, tds = 50, toc = 3, doc = 2.8, uv254 = 0.08) %>%
# note that we get a warning about sulfate from this code because we didn't specify sulfate in the define_water
chemdose_ph(alum = 30) %>%
chemdose_toc(alum = 30)
```
To model multiple water quality scenarios, use tidywater's helper functions (x_df) to
apply the models to a dataframe. The `pluck_cols` argument can be added to return the parameters impacted by the model
as separate columns. The `pluck_water` function can pull any parameter from a water into a separate column.
```{r}
coagulation <- water_df %>%
define_water_df(output_water = "raw") %>%
mutate(alum = 30) %>%
chemdose_ph_df(input_water = "raw", output_water = "phchange") %>% # return "phchange" water
chemdose_toc_df(input_water = "phchange", output_water = "coag", pluck_cols = TRUE) # return "coag" water and coag_doc, coag_toc, coag_uv254 as columns
## To get individual parameters, use `pluck_water`
coagulation <- coagulation %>%
pluck_water(input_waters = c("raw", "coag"), parameter = c("ph", "doc"))
```
Note that these functions use a "water" class. The "water" class is the foundation of the package;
it provides a mechanism for linking models in any order while maintaining water quality information.
The `define_water` function takes water quality inputs, but `define_water_df` may be used to convert
a dataframe to a list of "waters".
For more detailed examples on tidywater functions and how to use "water" class data, please see
the tidywater vignettes: `browseVignettes("tidywater")`
## Limitations
This project is maintained by volunteers and is provided without warranties or guarantees of any kind.
Use at your own risk. For official support, please contact Brown and Caldwell.
Please read our CONTRIBUTING.md and SECURITY.md before submitting issues or pull requests.
Owner metadata
- Name: Brown and Caldwell - Public
- Login: BrownandCaldwell-Public
- Email: kchambers@brwncald.com
- Kind: organization
- Description:
- Website: brownandcaldwell.com
- Location: United States of America
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/142610710?v=4
- Repositories: 1
- Last ynced at: 2023-10-25T22:38:55.876Z
- Profile URL: https://github.com/BrownandCaldwell-Public
GitHub Events
Total
- Release event: 7
- Delete event: 9
- Pull request event: 26
- Fork event: 3
- Issues event: 9
- Watch event: 15
- Issue comment event: 9
- Push event: 22
- Pull request review comment event: 8
- Gollum event: 3
- Pull request review event: 23
- Create event: 8
Last Year
- Release event: 1
- Delete event: 7
- Pull request event: 14
- Fork event: 1
- Issues event: 6
- Watch event: 2
- Issue comment event: 2
- Push event: 16
- Pull request review comment event: 5
- Pull request review event: 11
- Create event: 5
Committers metadata
Last synced: 2 months ago
Total Commits: 1,329
Total Committers: 15
Avg Commits per committer: 88.6
Development Distribution Score (DDS): 0.637
Commits in past year: 583
Committers in past year: 7
Avg Commits per committer in past year: 83.286
Development Distribution Score (DDS) in past year: 0.484
| Name | Commits | |
|---|---|---|
| Sierra Johnson | s****2@b****m | 483 |
| Libby McKenna | l****a@g****m | 408 |
| Jiaming Yuan | j****n@b****m | 301 |
| Riley E. Mulhern | r****n@b****m | 50 |
| rmerrifield1 | r****d@b****m | 21 |
| phoebechen19 | p****n@b****m | 18 |
| bengukilinc | b****c@b****m | 12 |
| Hzanib | 1****b | 11 |
| Riley E. Mulhern | 1****n | 9 |
| mayushiva1707 | M****m@B****m | 4 |
| carter | c****r@s****m | 4 |
| Chris Somerlot | c****t@b****m | 3 |
| Carter | C****s@m****m | 3 |
| awohlgemuth | a****h@b****m | 1 |
| Chris Somerlot | c****t@b****m | 1 |
Committer domains:
- brwncald.com: 10
- msn.com: 1
- schultz.com: 1
Issue and Pull Request metadata
Last synced: about 1 month ago
Total issues: 2
Total pull requests: 16
Average time to close issues: N/A
Average time to close pull requests: about 1 month
Total issue authors: 1
Total pull request authors: 4
Average comments per issue: 0.0
Average comments per pull request: 0.25
Merged pull request: 7
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 10
Past year average time to close issues: N/A
Past year average time to close pull requests: about 3 hours
Past year issue authors: 0
Past year pull request authors: 3
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 3
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- Carter12s (2)
Top Pull Request Authors
- sierrajohnson (10)
- Carter12s (3)
- csomerlot (2)
- libbymckenna (1)
Top Issue Labels
Top Pull Request Labels
- enhancement (1)
Package metadata
- Total packages: 1
-
Total downloads:
- cran: 196 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
- Total maintainers: 1
cran.r-project.org: tidywater
Water Quality Models for Drinking Water Treatment Processes
- Homepage: https://github.com/BrownandCaldwell-Public/tidywater
- Documentation: http://cran.r-project.org/web/packages/tidywater/tidywater.pdf
- Licenses: Apache License (≥ 2) | MIT + file LICENSE
- Latest release: 0.10.0 (published 7 months ago)
- Last Synced: 2026-02-21T17:35:59.107Z (about 1 month ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 196 Last month
-
Rankings:
- Dependent packages count: 27.836%
- Dependent repos count: 34.321%
- Average: 49.704%
- Downloads: 86.957%
- Maintainers (1)
Score: 11.249350467861682