powered by
Find number of episodes below a given glucose value for a given amount of time
num_events(x, times, thresh = 55, len = 15, gap = 5)
The integer number of events for a given dataset of glucose measurements and times.
vector of glucose readings
vector of corresponding times, in minutes
glucoses below this threshold are considered as part of an episode. Default is 55
minimum length of an episode. Default is 15
typical gap between CGM measurements, in minutes. Default is 5
num_events(x=c(rep(100, 10), rep(120, 10), 105, 85), times=seq(0, 1260, 60), thresh=55, len=15, gap=5)
Run the code above in your browser using DataLab