active_percent {iglu} | R Documentation |
Calculate percentage of time CGM was active
Description
The function 'active_percent' produces the
Usage
active_percent(data, dt0 = NULL)
Arguments
data |
DataFrame object with column names "id", "time", and "gl". |
dt0 |
The time frequency for interpolated aligned grid in minutes, the default will match the CGM meter's frequency (e.g. 5 min for Dexcom). |
Details
The function 'active_percent' produces a tibble object with values equal to the percentage of time the CGM was active, the total number of observed days, the start date, and the end date. For example, if a CGM's (5 min frequency) times were 0, 5, 10, 15 and glucose values were missing at time 5, then percentage of time the CGM was active is 75 The output columns correspond to the subject id, the percentage of time for which the CGM was active, the number of days of measurements, the start date and the end date of measurements. The output rows correspond to the subjects. The values of 'active_percent' are always between 0
Value
A tibble object with five columns: subject id, corresponding active_percent value, duration of measurement period in days, start date, and end date.
Author(s)
Pratik Patel, Irina Gaynanova
References
Danne et al. (2017) International Consensus on Use of Continuous Glucose Monitoring Diabetes Care 40 .1631-1640, doi:10.2337/dc17-1600.
Examples
data(example_data_1_subject)
active_percent(example_data_1_subject)
data(example_data_5_subject)
active_percent(example_data_5_subject)
active_percent(example_data_5_subject, dt0 = 5)