Skip to contents

Flags a glucose cycle as invalid if it contains gaps greater than 15 minutes or an incomplete sleep-wake interval, matching the QC criterion used for visual inspection of automated peak detections in the manuscript pipeline (see Figure 1 caption, Pugliane et al., 2026 preprint).

Usage

validate_cycle(cycle, max_gap_min = 15)

Arguments

cycle

An object of class sugaR_cycle, as returned by build_glucose_cycle().

max_gap_min

Numeric, maximum allowed gap (minutes) within the CGM trace. Default 15.

Value

The input cycle, with a logical valid attribute set, and a reason attribute describing why a cycle was excluded, if applicable.