View source: R/active_percent.R
active_percent | R Documentation |
The function 'active_percent' produces the
active_percent(data, dt0 = NULL, tz = "",
range_type = "automatic", ndays = 14, consistent_end_date = NULL)
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). |
tz |
tz = "". A character string specifying the time zone to be used. System-specific (see |
range_type |
range_type = "automatic". A character string indicating the type of range ('automatic' or 'manual'). |
ndays |
ndays = 14. An integer specifying the number of days to consider in the calculation. |
consistent_end_date |
consistent_end_date = NULL. A Date object or NULL indicating a period end date to be used for every subject. Leaving this value NULL will result in the end date being unique to each subject. |
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
A tibble object with five columns: subject id, corresponding active_percent value, duration of measurement period in days, start date, and end date.
Pratik Patel, Irina Gaynanova
Danne et al. (2017) International Consensus on Use of Continuous Glucose Monitoring Diabetes Care 40 .1631-1640, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2337/dc17-1600")}.
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, tz = 'GMT')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.