Skip to contents

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.

Usage

group_peaks(peaks, window_min = 120, tol = 10)

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.

Value

A data frame of grouped peaks, one row per group.