build_fit_results: Assemble a fitted channel result

View source: R/aanalyse_kinetics_helpers.R

build_fit_resultsR Documentation

Assemble a fitted channel result

Description

Counterpart of build_na_results() for a successful fit: the coefs/model/fitted_data/diag list expected by analyse_kinetics_channels(), with fitted values and diagnostics derived from model on the rows in keep.

Usage

build_fit_results(
  coefs,
  model,
  x_fit,
  t_fit,
  valid,
  keep = TRUE,
  env = rlang::caller_env()
)

Arguments

coefs

A 1-row data.frame of method coefficients.

model

A fitted model supporting stats::predict() and stats::coef().

x_fit, t_fit

Numeric vectors of the channel fit window.

valid

The find_kinetics_idx() result for the channel.

keep

Logical row filter of the fit window used by model.

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

A named list with elements coefs, model, fitted_data, and diag.


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