Package: tidywater 0.7.0

Sierra Johnson

tidywater: Water Quality Models for Drinking Water Treatment Processes

Provides multiple water chemistry-based models and published empirical models in one standard format. Functions can be chained together to model a complete treatment process and are designed to work in a 'tidyverse' workflow. Models are primarily based on these sources: Benjamin, M. M. (2002, ISBN:147862308X), Crittenden, J. C., Trussell, R., Hand, D., Howe, J. K., & Tchobanoglous, G., Borchardt, J. H. (2012, ISBN:9781118131473), USEPA. (2001) <https://www.epa.gov/sites/default/files/2017-03/documents/wtp_model_v._2.0_manual_508.pdf>.

Authors:Sierra Johnson [aut, cre], Libby McKenna [aut], Riley Mulhern [aut], Chris Corwin [aut], Rachel Merrifield [ctb], Mayuri Namasivayam [ctb], Phoebe Chen [ctb], USEPA [cph], Brown and Caldwell [fnd, cph]

tidywater_0.7.0.tar.gz
tidywater_0.7.0.zip(r-4.5)tidywater_0.7.0.zip(r-4.4)tidywater_0.7.0.zip(r-4.3)
tidywater_0.7.0.tgz(r-4.4-any)tidywater_0.7.0.tgz(r-4.3-any)
tidywater_0.7.0.tar.gz(r-4.5-noble)tidywater_0.7.0.tar.gz(r-4.4-noble)
tidywater_0.7.0.tgz(r-4.4-emscripten)tidywater_0.7.0.tgz(r-4.3-emscripten)
tidywater.pdf |tidywater.html
tidywater/json (API)
NEWS

# Install 'tidywater' in R:
install.packages('tidywater', repos = c('https://brownandcaldwell-public.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/brownandcaldwell-public/tidywater/issues

Datasets:
  • bromatecoeffs - Data frame of bromate coefficients for predicting bromate formation during ozonation
  • chloramine_conv - Data frame of conversion factors for estimating DBP formation from chloramines
  • cl2coeffs - Data frame of Cl2 decay coefficients
  • dbp_correction - Data frame of correction factors for estimating DBP formation as a function of location
  • dbpcoeffs - Data frame of DBP coefficients for predicting DBP formation
  • discons - Dissociation constants and standard enthalpy for weak acids/bases
  • edwardscoeff - Data frame of Edwards model coefficients
  • leadsol_constants - Data frame of equilibrium constants for lead and copper solubility
  • mweights - Molar weights of relevant compounds
  • water_df - Data frame of water quality parameters

On CRAN:

6.58 score 9 stars 14 scripts 599 downloads 62 exports 50 dependencies

Last updated 28 days agofrom:f52f2cdc33. Checks:7 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKJan 22 2025
R-4.5-winOKJan 22 2025
R-4.5-linuxOKJan 22 2025
R-4.4-winOKJan 22 2025
R-4.4-macOKJan 22 2025
R-4.3-winOKJan 22 2025
R-4.3-macOKJan 22 2025

Exports:%>%balance_ionsbalance_ions_chainbalance_ions_oncebiofilter_tocbiofilter_toc_chainbiofilter_toc_onceblend_watersblend_waters_chainblend_waters_oncecalculate_corrosioncalculate_corrosion_chaincalculate_corrosion_oncecalculate_diccalculate_hardnesschemdose_chlordecaychemdose_chlordecay_chainchemdose_chlordecay_oncechemdose_dbpchemdose_dbp_chainchemdose_dbp_oncechemdose_fchemdose_phchemdose_ph_chainchemdose_ph_oncechemdose_tocchemdose_toc_chainchemdose_toc_onceconvert_unitsconvert_waterconvert_watermgdefine_waterdefine_water_chaindefine_water_oncedissolve_pbdissolve_pb_onceozonate_bromateozonate_bromate_chainozonate_bromate_oncepac_tocpac_toc_chainpac_toc_onceplot_ionspluck_watersolvecost_chemsolvecost_laborsolvecost_powersolvecost_solidssolvect_chlorinesolvect_chlorine_oncesolvect_o3solvect_o3_oncesolvedose_alksolvedose_alk_oncesolvedose_phsolvedose_ph_oncesolvemass_chemsolvemass_solidssolveresid_o3solveresid_o3_oncesummarise_wqsummarize_wq

Dependencies:clicodetoolscolorspacecpp11digestdplyrevaluatefansifarverfurrrfuturegenericsggplot2ggrepelglobalsgluegtablehighrisobandknitrlabelinglatticelifecyclelistenvmagrittrMASSMatrixmgcvmunsellnlmeparallellypillarpkgconfigpurrrR6RColorBrewerRcpprlangscalesstringistringrtibbletidyrtidyselectutf8vctrsviridisLitewithrxfunyaml

Getting started with tidywater

Rendered fromtidywater.Rmdusingknitr::rmarkdownon Jan 22 2025.

Last update: 2024-10-22
Started: 2024-10-22

Helper Functions: Blending Multiple Waters

Rendered fromhelp_functions_blend_waters.Rmdusingknitr::rmarkdownon Jan 22 2025.

Last update: 2024-11-15
Started: 2024-10-22

Helper Functions: Dose chemicals

Rendered fromhelp_functions_chemdose_ph.Rmdusingknitr::rmarkdownon Jan 22 2025.

Last update: 2024-11-15
Started: 2024-10-22

Introduction to tidywater: Basic functions

Rendered fromintro.Rmdusingknitr::rmarkdownon Jan 22 2025.

Last update: 2025-01-22
Started: 2024-10-22

Readme and manuals

Help Manual

Help pageTopics
Add Na, K, Cl, or SO4 to balance overall charge in a waterbalance_ions
Apply `balance_ions` within a dataframe and output a column of `water` class to be chained to other tidywater functionsbalance_ions_chain
Apply `balance_ions` function and output a dataframebalance_ions_once
Determine TOC removal from biofiltration using Terry & Summers BDOC modelbiofilter_toc
Apply `biofilter_toc` within a dataframe and output a column of `water` class to be chained to other tidywater functionsbiofilter_toc_chain
Apply `biofilter_toc` function and output a data framebiofilter_toc_once
Determine blended water quality from multiple waters based on mass balance and acid/base equilibriumblend_waters
Apply `blend_waters` within a dataframe and output a column of `water` class to be chained to other tidywater functionsblend_waters_chain
Apply `blend_waters` to a dataframe and output `water` slots as a dataframeblend_waters_once
Data frame of bromate coefficients for predicting bromate formation during ozonationbromatecoeffs
Calculate six corrosion and scaling indices (AI, RI, LSI, LI, CSMR, CCPP)calculate_corrosion
Apply `calculate_corrosion` to a dataframe and output a column of `water` class to be chained to other tidywater functions.calculate_corrosion_chain
Apply `calculate_corrosion` to a dataframe and create new columns with up to 6 corrosion indicescalculate_corrosion_once
Calculate dissolved inorganic carbon (DIC) from total carbonatecalculate_dic
Calculate hardness from calcium and magnesiumcalculate_hardness
Calculate chlorine decaychemdose_chlordecay
Apply `chemdose_chlordecay` within a data frame and output a column of `water` class to be chained to other tidywater functionschemdose_chlordecay_chain
Apply `chemdose_chlordecay`function within a data frame and output a data framechemdose_chlordecay_once
Calculate DBP formationchemdose_dbp
Apply `chemdose_dbp` within a data frame and output a column of `water` class to be chained to other tidywater functionschemdose_dbp_chain
Apply `chemdose_dbp`function within a data frame and output a data framechemdose_dbp_once
Calculate new fluoride concentration after dosing alum.chemdose_f
Calculate new pH and ion balance after chemical additionchemdose_ph
Apply `chemdose_ph` within a dataframe and output a column of `water` class to be chained to other tidywater functionschemdose_ph_chain
Apply `chemdose_ph` function and output a dataframechemdose_ph_once
Determine TOC removal from coagulationchemdose_toc
Apply `chemdose_toc` within a dataframe and output a column of `water` class to be chained to other tidywater functionschemdose_toc_chain
Apply `chemdose_toc` function and output a data framechemdose_toc_once
Data frame of conversion factors for estimating DBP formation from chloramineschloramine_conv
Data frame of Cl2 decay coefficientscl2coeffs
Calculate unit conversions for common compoundsconvert_units
Convert `water` class object to a dataframeconvert_water
Convert a `water` class object to a dataframe with ions in mg/L or ug/Lconvert_watermg
Data frame of correction factors for estimating DBP formation as a function of locationdbp_correction
Data frame of DBP coefficients for predicting DBP formationdbpcoeffs
Create a water class object given water quality parametersdefine_water
Apply `define_water` within a dataframe and output a column of `water` class to be chained to other tidywater functionsdefine_water_chain
Apply `define_water` and output a dataframedefine_water_once
Dissociation constants and standard enthalpy for weak acids/basesdiscons
Simulate contributions of various lead solids to total soluble leaddissolve_pb
Apply `dissolve_pb` to a dataframe and create a new column with numeric dosedissolve_pb_once
Data frame of Edwards model coefficientsedwardscoeff
Data frame of equilibrium constants for lead and copper solubilityleadsol_constants
Molar weights of relevant compoundsmweights
Calculate bromate formationozonate_bromate
Apply `ozonate_bromate` within a data frame and output a column of `water` class to be chained to other tidywater functionsozonate_bromate_chain
Apply `ozonate_bromate`function within a data frame and output a data frameozonate_bromate_once
Calculate DOC Concentration in PAC systempac_toc
Apply `pac_toc` within a data frame and output a column of `water` class to be chained to other tidywater functions PAC = powdered activated carbonpac_toc_chain
Apply `pac_toc`function within a data frame and output a data framepac_toc_once
Create summary plot of ions from water classplot_ions
Pluck out a single parameter from a `water` class objectpluck_water
Determine chemical costsolvecost_chem
Determine labor costsolvecost_labor
Determine power costsolvecost_power
Determine solids disposal costsolvecost_solids
Determine disinfection credit from chlorine.solvect_chlorine
Apply `solvect_chlorine` to a data frame and create new columns with ct and log removals.solvect_chlorine_once
Determine disinfection credit from ozone.solvect_o3
Apply `solvect_o3` to a data frame and create new columns with ct and log removals.solvect_o3_once
Calculate a desired chemical dose for a target alkalinitysolvedose_alk
Apply `solvedose_alk` to a dataframe and create a new column with numeric dosesolvedose_alk_once
Calculate a desired chemical dose for a target pHsolvedose_ph
Apply `solvedose_ph` to a dataframe and create a new column with numeric dosesolvedose_ph_once
Convert mg/L of chemical to lb/daysolvemass_chem
Determine solids lb/daysolvemass_solids
Determine ozone decaysolveresid_o3
Apply `solveresid_o3` to a data frame and create a new column with residual ozone dosesolveresid_o3_once
Create summary table from water classsummarise_wq summarize_wq
Data frame of water quality parameterswater_df