Learn R Programming

rGV (version 0.0.5)

num_events: Find number of episodes below a given glucose value for a given amount of time

Description

Find number of episodes below a given glucose value for a given amount of time

Usage

num_events(x, times, thresh = 55, len = 15, gap = 5)

Value

The integer number of events for a given dataset of glucose measurements and times.

Arguments

x

vector of glucose readings

times

vector of corresponding times, in minutes

thresh

glucoses below this threshold are considered as part of an episode. Default is 55

len

minimum length of an episode. Default is 15

gap

typical gap between CGM measurements, in minutes. Default is 5

Examples

Run this code
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