split_kinetics_groups: Split interval data frames into sample groups

View source: R/aanalyse_kinetics_helpers.R

split_kinetics_groupsR Documentation

Split interval data frames into sample groups

Description

Applies the group_intervals argument of analyse_kinetics() to a named list of data frames. "ensemble" returns data_list unchanged; a list() of sample (row) indices subsets every data frame into one interval per group. Samples in no group are dropped and samples in several groups are warned about. Group names become interval names (⁠interval_<n>⁠ when unnamed), suffixed ⁠<group>_<df>⁠ when data_list holds more than one data frame. Row-subset intervals no longer correspond to their interval_times/interval_span metadata, so those attributes are dropped.

Usage

split_kinetics_groups(
  data_list,
  group_intervals,
  verbose = TRUE,
  env = rlang::caller_env()
)

Arguments

data_list

Named list of data frames from as_data_list().

group_intervals

"ensemble" or a list() of integer-valued sample index vectors; see analyse_kinetics().

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

A named list of data frames, one per group per data frame.


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