validate_kinetics_args: Validate resolved per-channel kinetics arguments

View source: R/aanalyse_kinetics_helpers.R

validate_kinetics_argsR Documentation

Validate resolved per-channel kinetics arguments

Description

Validates each channel's resolved argument list once, before any fitting, so an invalid argument fails fast rather than after an expensive fit on an earlier channel. Validation is keyed on which arguments are present. Mutating validators are applied and written back: validate_start_time() clamps start_time, and align is matched to its choices. Verbose hints are emitted for the first channel only to avoid repeating identical messages.

Usage

validate_kinetics_args(
  per_channel,
  data,
  t_vec,
  verbose = TRUE,
  env = rlang::caller_env()
)

Arguments

per_channel

Named list of resolved argument lists, one per channel.

data

A data frame of class "mnirs" containing time series data and metadata.

t_vec

Numeric vector of time_channel values.

verbose

Logical. TRUE (default) will display, and FALSE will silence warnings and information messages helpful for troubleshooting. Global default can be set via options(mnirs.verbose = FALSE).

env

The calling environment or a defused call, used to report errors and warnings as coming from the user-facing function rather than the validator.

Value

The per_channel list with mutating validators applied.


mnirs documentation built on Sept. 13, 2026, 1:06 a.m.