View source: R/analyse_peak_slope.R
| analyse_peak_slope | R Documentation |
Internal channel-level dispatch for
analyse_kinetics(method = "peak_slope"). Computes the maximum local
linear slope for each nirs_channel within a single "mnirs" data
frame. See analyse_kinetics() for user-facing documentation.
analyse_peak_slope(
data,
nirs_channels = NULL,
time_channel = NULL,
start_time = NULL,
width = NULL,
span = NULL,
align = c("centre", "left", "right"),
direction = c("auto", "positive", "negative"),
end_window = Inf,
partial = FALSE,
na.rm = FALSE,
verbose = TRUE,
...,
env = rlang::caller_env()
)
data |
A data frame of class "mnirs" containing time series data and metadata. |
nirs_channels |
A character vector giving the names of mNIRS columns to
operate on. Must match column names in
|
time_channel |
A character string naming the time or sample column.
Must match a column name in
|
start_time |
A numeric value in units of |
width |
An integer defining the local window in number of samples
around |
span |
A numeric value defining the local window time span around |
align |
Window alignment as "centre"/"center" (the default), "left", or "right". Where "left" is forward looking, and "right" is backward looking from the current sample. |
direction |
A character string specifying the response direction
|
end_window |
A numeric value in units of For "biexponential", |
partial |
Logical; default is |
na.rm |
Logical; default is |
verbose |
Logical. |
... |
Additional arguments. |
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. |
A data.frame with one row per nirs_channel and columns
nirs_channels, slope, intercept, y, peak_slope_time, idx.
Per-channel metadata are attached as attributes:
"model": a linear regression model object via stats::lm().
"fitted_data": a named list of per-channel data frames with
columns window_idx and fitted.
"diagnostics": a data.frame with one row per nirs_channel
containing model fit diagnostics.
"channel_args": a data.frame with one row per nirs_channel
recording the resolved arguments used.
analyse_kinetics(), peak_slope()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.