View source: R/variability_metrics.R
| modd_rcpp | R Documentation |
Calculates Mean of Daily Differences (MODD) with an Rcpp backend. The
preprocessing follows the iglu day-grid approach used by
iglu::modd: CGM data are linearly interpolated to
a regular midnight-aligned full-day grid, respecting inter_gap, before
same-time-of-day differences are calculated.
modd_rcpp(data, lag = 1, tz = "", inter_gap = 45)
data |
A dataframe containing CGM data with columns:
|
lag |
Whole number of days separating paired same-time-of-day glucose observations. Defaults to 1. |
tz |
Time zone used for day-grid alignment when supplied. |
inter_gap |
Maximum gap, in minutes, over which linear interpolation is allowed. Defaults to 45, matching iglu's internal default. |
A tibble with columns id and MODD.
Service, F. John, and Roger L. Nelson. "Characteristics of glycemic stability." Diabetes Care 3.1 (1980): 58-62.
iglu::modd, conga_rcpp,
mage_rcpp
library(iglu)
data(example_data_5_subject)
modd_rcpp(example_data_5_subject)
modd_rcpp(example_data_5_subject, lag = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.