Title: | Analyzing Glucose and Glucose Variability |
---|---|
Description: | Continuous glucose monitoring (CGM) systems provide real-time, dynamic glucose information by tracking interstitial glucose values throughout the day. Glycemic variability, also known as glucose variability, is an established risk factor for hypoglycemia (Kovatchev) and has been shown to be a risk factor in diabetes complications. Over 20 metrics of glycemic variability have been identified. Here, we provide functions to calculate glucose summary metrics, glucose variability metrics (as defined in clinical publications), and visualizations to visualize trends in CGM data. Cho P, Bent B, Wittmann A, et al. (2020) <https://diabetes.diabetesjournals.org/content/69/Supplement_1/73-LB.abstract> American Diabetes Association (2020) <https://professional.diabetes.org/diapro/glucose_calc> Kovatchev B (2019) <doi:10.1177/1932296819826111> Kovdeatchev BP (2017) <doi:10.1038/nrendo.2017.3> Tamborlane W V., Beck RW, Bode BW, et al. (2008) <doi:10.1056/NEJMoa0805017> Umpierrez GE, P. Kovatchev B (2018) <doi:10.1016/j.amjms.2018.09.010>. |
Authors: | Maria Henriquez [aut, com, cph, cre, trl], Brinnae Bent [aut, cph, dtc] |
Maintainer: | Maria Henriquez <[email protected]> |
License: | MIT License + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-08 06:40:59 UTC |
Source: | CRAN |
This function computes the estimated A1c, according to the American Diabetes Association calculator
eA1c(df)
eA1c(df)
df |
Data frame read through readfile |
A numeric value representing eA1c
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) eA1c(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) eA1c(mydata)
This function computes the estimated GMI
GMI(df)
GMI(df)
df |
Data frame read through readfile |
A numeric value representing GMI
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) GMI(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) GMI(mydata)
This function computes the high blood glucose index
HBGI(df)
HBGI(df)
df |
Data frame read through readfile |
A numeric value representing HBGI
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) HBGI(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) HBGI(mydata)
This function computes the interday coefficient of variation
interdaycv(df)
interdaycv(df)
df |
Data frame read through readfile |
A numeric value representing interday cv
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) interdaycv(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) interdaycv(mydata)
This function computes the interday standard deviation
interdaysd(df)
interdaysd(df)
df |
Data frame read through readfile |
A numeric value representing interday sd
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) interdaysd(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) interdaysd(mydata)
This function computes the intraday coefficient of variation summary statistics: mean, median, standard deviation of all days in data
intradaycv(df)
intradaycv(df)
df |
Data frame read through readfile |
A data frame containing the mean, median, and standard deviation of the intraday coefficients of variation.
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) intradaycv(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) intradaycv(mydata)
This function computes the intraday standard deviation summary statistics: mean, median, standard deviation of all days in data
intradaysd(df)
intradaysd(df)
df |
Data frame read through readfile |
A data frame containing the mean, median, and standard deviation of the intraday standard deviations.
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) intradaysd(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) intradaysd(mydata)
This function computes J-index, a glycemic variability metrix
J_index(df)
J_index(df)
df |
Data frame read through readfile |
A numeric value representing J-index
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) J_index(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) J_index(mydata)
This function computes the low blood glucose index
LBGI(df)
LBGI(df)
df |
Data frame read through readfile |
A numeric value representing LBGI
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) LBGI(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) LBGI(mydata)
This function computes the low blood glucose index
LBGI_HBGI(df)
LBGI_HBGI(df)
df |
Data frame read through readfile |
A data frame containing both the LBGI and HBGI values
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) LBGI_HBGI(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) LBGI_HBGI(mydata)
This function computes the mean of glycemic excursions, glycemic excursions indicated by standard deviation, default = 1
MGE(df, sd = 1)
MGE(df, sd = 1)
df |
Data frame read through readfile |
sd |
Standard deviation indicating glycemic excursion, default = 1 |
A numeric value representing MAGE
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) MGE(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) MGE(mydata)
This function computes the mean of normal glucose, glycemic excursions indicated by standard deviation, default = 1
MGN(df)
MGN(df)
df |
Data frame read through readfile |
A numeric value representing MGN
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) MGN(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) MGN(mydata)
This function plots glycemic excursions over the time period in which data was collected.
plot_glucose(df)
plot_glucose(df)
df |
Data frame read through readfile |
None
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) plot_glucose(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) plot_glucose(mydata)
This function computes the percent of time outside range (range in standard deviations from mean, default = 1).
POR(df, sd = 1, sr = 5)
POR(df, sd = 1, sr = 5)
df |
Data frame read through readfile |
sd |
Standard deviation indicating glycemic excursion, default = 1 |
sr |
Sampling rate inverse in minutes of the CGM (default is Dexcom -> 5 minutes) |
A numeric value representing POR
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) POR(mydata, sd = 1, sr = 5)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) POR(mydata, sd = 1, sr = 5)
This function reads in a .csv with variable names Timestamp..YYYY.MM.DDThh.mm.ss and Glucose.Value..mg.dL
readfile(filename)
readfile(filename)
filename |
.csv file of data frame to be read |
transformed data frame for further analysis
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") readfile(mydatafile)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") readfile(mydatafile)
This function computes the mean, median, minimum, maximum, first quartile, and the third quartile of an indidividual's overall glucose levels
summary_glucose(df)
summary_glucose(df)
df |
Data frame read through readfile |
A dataframe containing the mean, median, minimum, maximum, quartile1, and quartile3 of glucose levels
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) summary_glucose(mydata)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) summary_glucose(mydata)
This function computes the time inside range (range in standard deviations from mean, default = 1).
TIR(df, sd = 1, sr = 5)
TIR(df, sd = 1, sr = 5)
df |
Data frame read through readfile |
sd |
Standard deviation indicating glycemic excursions, default = 1 |
sr |
Sampling rate inverse in minutes of the CGM (default is the Dexcom -> 5 minutes) |
A numeric value representing TIR
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) TIR(mydata, sd = 1, sr = 5)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) TIR(mydata, sd = 1, sr = 5)
This function computes the time outside range (range in standard deviations from mean, default = 1).
TOR(df, sd = 1, sr = 5)
TOR(df, sd = 1, sr = 5)
df |
Data frame read through readfile |
sd |
Standard deviation indicating glycemic excursions, default = 1 |
sr |
Sampling rate inverse in minutes of the CGM (default is the Dexcom -> 5 minutes) |
A numeric value representing TOR
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) TOR(mydata, sd = 1, sr = 5)
mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify") mydata <- readfile(mydatafile) TOR(mydata, sd = 1, sr = 5)