R/preprocessing.R
filter_physiological_rr.RdFilters RR intervals to remove physiologically implausible values based on minimum and maximum thresholds. This is typically the first step in RR interval preprocessing.
filter_physiological_rr(rr_intervals, min_rr = 272, max_rr = 2000)A logical vector of the same length as rr_intervals, where TRUE
indicates the RR interval is within physiological bounds
This function applies basic physiological constraints to RR intervals:
Values below min_rr are considered too fast (unrealistic heart rates)
Values above max_rr are considered too slow (unrealistic heart rates)
The default range corresponds to heart rates between 30-220 bpm
if (FALSE) { # \dontrun{
rr_data <- c(800, 850, 200, 900, 2500, 820) # Some with artifacts
valid_mask <- filter_physiological_rr(rr_data)
clean_rr <- rr_data[valid_mask]
} # }