View source: R/aanalyse_kinetics_helpers.R
| detect_direction | R Documentation |
Resolves whether a signal responds upward ("positive") or downward
("negative") by comparing the excursions of x above and below its
initial baseline, taken as the median of the earliest samples ordered
by t. The dominant excursion captures the primary response direction
even when a fast initial component partially recovers over most of the
record (e.g. biexponential drop-recovery), where a net slope would
misreport the trend. Used internally to disambiguate peak (maximum)
from trough (minimum) detection when direction = "auto".
detect_direction(
x,
t = seq_along(x),
fallback = x,
direction = c("auto", "positive", "negative")
)
x |
A numeric vector of the response variable. |
t |
An optional numeric vector of the predictor variable (e.g. time).
Default is |
fallback |
A numeric vector (defaults to |
direction |
A character string specifying the response direction to
detect when |
A character string: "positive" or "negative".
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.