| drift_detect | R Documentation |
Detects potential sensor drift by comparing rolling window statistics (mean or standard deviation) to their long-term baseline. Returns a logical matrix indicating time points where the rolling statistic deviates beyond a threshold.
drift_detect(data, cols = NULL, window = 30, threshold = 3,
method = c("mean", "sd"), group = NULL,
date_col = NULL, verbose = FALSE)
data |
A data frame, matrix, or numeric vector. |
cols |
Column indices or names of numeric variables. If |
window |
Window size for rolling statistics. |
threshold |
Threshold in units of standard deviation. Values with absolute z-score above this are flagged as drift. |
method |
Rolling statistic to use: |
group |
Optional grouping column for group-wise detection. |
date_col |
Optional time column (not required for calculation). |
verbose |
Logical; if |
A logical matrix with rows corresponding to observations and columns to the selected variables. TRUE indicates suspected drift.
drift_detect(data[1:500, c(1, 4, 17:19)], cols = 3:5, window = 50, threshold = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.