Learn R Programming

wqtrends

R package to assess water quality trends for long-term monitoring data in estuaries using Generalized Additive Models with error propagation from mixed-effect meta-analysis. Uses concepts in the mgcv and mixmeta packages. Detailed information on the methods used in this package are described in the following open access article:

Beck, M.W., de Valpine, P., Murphy, R., Wren, I., Chelsky, A., Foley, M., Senn, D.B. 2022. Multi-scale trend analysis of water quality using error propagation of Generalized Additive Models. Science of the Total Environment. 802:149927. https://doi.org/10.1016/j.scitotenv.2021.149927

Installation

Install the package from CRAN as follows. The development version of the package can be installed from r-universe. The source code is available on GitHub.

# Install wqtrends in R:
install.packages('wqtrends')

# load wqtrends
library(wqtrends)

Issues and suggestions

Please report any issues and suggestions on the issues link for the repository.

Copy Link

Version

Install

install.packages('wqtrends')

Monthly Downloads

383

Version

1.5.1

License

CC0

Issues

Pull Requests

Stars

Forks

Maintainer

Marcus W. Beck

Last Published

July 9th, 2025

Functions in wqtrends (1.5.1)

show_perchg

Plot percent change trends from GAM results for selected time periods
show_mettrndseason

Plot seasonal metrics and rates of change
show_prdseries

Plot predictions for GAMs over time series
show_prdseason

Plot predictions for GAMs over time, by season
show_sumtrndseason2

Plot seasonal rates of change in quarters based on average estimates for multiple window widths
show_sumtrndseason

Plot seasonal rates of change based on average estimates for multiple window widths
show_prddoy

Plot predictions for GAMs against day of year
anlz_trans

Transform response variable
anlz_trndseason

Estimate rates of change based on seasonal metrics
show_prd3d

Plot a 3-d surface of predictions
anlz_metseason

Extract period (seasonal) metrics from fitted GAM
anlz_avgseason

Extract period (seasonal) averages from fitted GAM
anlz_backtrans

Back-transform response variable
anlz_mixmeta

Fit a mixed meta-analysis regression model of trends
anlz_pvalformat

Format p-values for show functions
anlz_sumtrndseason

Estimate seasonal rates of change based on average estimates for multiple window widths
anlz_sumstats

Retrieve summary statistics for seasonal metrics and trend results
anlz_smooth

Return summary statistics for smoothers of GAMs
show_trndseason

Plot rates of change based on seasonal metrics
anlz_perchg

Estimate percent change trends from GAM results for selected time periods
anlz_prd

Get predicted data from fitted GAMs across period of observation
anlz_prdmatrix

Get prediction matrix for a fitted GAM
anlz_prdday

Get predicted data from fitted GAMs across period of observation, every day
anlz_fit

Return summary statistics for GAM fits
anlz_gam

Fit a generalized additive model to a water quality time series
show_metseason

Plot period (seasonal) averages from fitted GAM
rawdat

Raw data from San Francisco Estuary (South Bay)