Overview

aelab is an R package for aquatic ecology data analysis. It provides tools for:

  1. GHG flux calculation — process raw data from LI-COR and LGR gas analyzers, calculate chamber flux, convert units, compute Minimum Detectable Flux (MDF), and aggregate to CO₂-equivalents.
  2. Net ecosystem metabolism (NEM) — calculate gross primary production (GPP), ecosystem respiration (ER), and net ecosystem production (NEP) from high-frequency dissolved oxygen data.
  3. Statistical analysis — descriptive statistics, outlier detection, normality testing, data transformation, one-way ANOVA (Tukey HSD), and Kruskal-Wallis (Dunn post-hoc) with compact letter display.
  4. Visualization — ggplot2-based plot wrappers (point, line, box, bar) with a consistent theme and custom colour palettes.
  5. Gantt-style progress tables — gantt_table() renders a coloured flextable (PDF/DOCX/PPTX-compatible) where columns are sampling campaigns and rows are measurement categories × systems; gantt_text() renders the same data as Unicode text for terminal/Neovim viewing.

GHG Flux — What's New (v1.1.5)

calculate_regression() has been substantially extended:

make_reference() builds a reference_df for calculate_regression() from a compact multiline string of field notes — one closure per line: time site analyzer [dur=N] [off=N]. Optionally writes the result to .xlsx.

window_type = "pareto" independently searches deadband (start skip) and cutoff (window end) times per closure, trading off model fit against propagated slope uncertainty via a Pareto front — adapted from Kobayashi et al. (2026), with the existing kappamax gate and zero/discard fallback always applied so no candidate can be a numerically degenerate fit and no empty or failing candidate pool is reported as a confident number. New output columns: deadband, cutoff, slope_uncertainty_lo, slope_uncertainty_hi, n_candidates.

References

Installation

The aelab package can be installed from:

  1. GitHub (development version):
# install.packages("devtools")
# devtools::install_github("Zhao-Jun-Yong/aelab")
install.packages("aelab", repos = c('https://zhao-jun-yong.r-universe.dev', 'https://cloud.r-project.org'))
  1. CRAN (stable version):
install.packages("aelab")

Features

For a full walkthrough with worked examples and code output, see the package vignette:

vignette("aelab")