apply_prm: Apply Physical Range Module (PRM) bounds to AmeriFlux-style...

View source: R/prm.R

apply_prmR Documentation

Apply Physical Range Module (PRM) bounds to AmeriFlux-style data

Description

Clamps values to PRM ranges by variable family (e.g., ⁠^SWC($|_)⁠, ⁠^P($|_)⁠). Columns with "QC" in their names are skipped by default. Out-of-range values are set to NA. No columns are removed.

Usage

apply_prm(.data, include = NULL, skip_qc = TRUE, note = TRUE, summarize = TRUE)

Arguments

.data

A data.frame or tibble.

include

Optional character vector of base family names to apply (e.g., "SWC", "P"). If NULL, all families are applied.

skip_qc

Logical; when TRUE, skip columns that look like flags: names ending/containing ⁠_QC⁠ or ⁠_SSITC_TEST⁠ (case-insensitive). Default: TRUE.

note

Logical; print a per-column summary with expected units, PRM range, and counts.

summarize

Logical; if TRUE, return a list with data and summary; otherwise return only the clamped data frame.

Value

If summarize = TRUE, a list with data and summary; else a data.frame.


fluxtools documentation built on Aug. 22, 2025, 1:09 a.m.