Merges candidate peaks that occur within a short time window and differ by a small glucose value, so that closely spaced detections are treated as a single peak event.
Arguments
- peaks
A data frame of candidate peaks, as returned by
detect_candidate_peaks().- window_min
Numeric, maximum time separation (minutes) for two peaks to be grouped. Default
120.- tol
Numeric, maximum glucose difference (mg/dL) for two peaks to be grouped. Default
10.