
Apply conservative rule-based IBI corrections
Source:R/beat-correction-audit.R
correct_gazepoint_beats.RdApplies a conservative correction action to beats flagged by
audit_gazepoint_beats(). The default action masks flagged intervals by
setting their corrected IBI to NA. The local-median action replaces
flagged intervals only when an unflagged local or group median is available.
Every change is logged. The function does not add or remove beat rows and does
not compute or interpret HRV outcomes.
Usage
correct_gazepoint_beats(
audit,
action = c("mask", "local_median"),
corrected_col = "ibi_corrected",
local_window = 5,
overwrite = FALSE,
...
)Arguments
- audit
A
gazepoint_beat_auditobject, or a data frame that can be passed toaudit_gazepoint_beats().- action
Correction action. One of
"mask"or"local_median".- corrected_col
Name of the corrected IBI column to create.
- local_window
Number of rows on each side to inspect for local-median replacement when
action = "local_median".- overwrite
Logical. If
TRUE, overwrite an existing corrected column.- ...
Arguments passed to
audit_gazepoint_beats()whenauditis a data frame.