Skip to contents

Smoothing

Savitzky-Golay smoothing of raw CGM traces.

sg_smooth()
Smooth a glucose trace with a Savitzky-Golay filter

Baseline

Pre-wake sleep baseline computation and correction.

compute_baseline()
Compute pre-wake sleep glucose baseline
correct_baseline()
Correct a glucose baseline using global sleep metrics

Peak detection

Candidate glucose peak detection and grouping.

detect_candidate_peaks()
Detect candidate glucose peaks
group_peaks()
Group nearby candidate peaks
select_first_peak()
Select the first post-wake glucose peak

Onset & offset

Hierarchical rules for locating peak onset and offset.

find_onset()
Find the onset of a glucose peak
find_offset()
Find the offset of a glucose peak

Cycle construction

Sleep-wake-anchored glucose cycle assembly and QC.

build_glucose_cycle()
Build a glucose cycle anchored to a sleep-wake episode
validate_cycle()
Validate a glucose cycle for analysis

Metrics

Participant-level regularity metrics.

compute_fgptstd()
Compute first post-wake glucose peak timing variability (fGPTstd)

Visualisation

Actogram-style plotting for visual QC.

plot_glucose_actogram()
Plot a glucose actogram

Data structures

Core S3 objects for glucose traces and cycles.

glucose_trace()
Construct a glucose trace object
glucose_cycle()
Construct a glucose cycle object

Package

Package-level documentation.

sugaR sugaR-package
sugaR: Continuous Glucose Monitoring Analysis for Chronobiology Research