Package 'cgmquantify'

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

Help Index


Compute Estimated A1c

Description

This function computes the estimated A1c, according to the American Diabetes Association calculator

Usage

eA1c(df)

Arguments

df

Data frame read through readfile

Value

A numeric value representing eA1c

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
eA1c(mydata)

Compute Glycemic Management Indicator

Description

This function computes the estimated GMI

Usage

GMI(df)

Arguments

df

Data frame read through readfile

Value

A numeric value representing GMI

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
GMI(mydata)

Compute High Blood Glucose Index

Description

This function computes the high blood glucose index

Usage

HBGI(df)

Arguments

df

Data frame read through readfile

Value

A numeric value representing HBGI

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
HBGI(mydata)

Compute Interday Coefficient of Variation

Description

This function computes the interday coefficient of variation

Usage

interdaycv(df)

Arguments

df

Data frame read through readfile

Value

A numeric value representing interday cv

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
interdaycv(mydata)

Compute Interday Standard Deviation

Description

This function computes the interday standard deviation

Usage

interdaysd(df)

Arguments

df

Data frame read through readfile

Value

A numeric value representing interday sd

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
interdaysd(mydata)

Compute Intraday Coefficient of Variation

Description

This function computes the intraday coefficient of variation summary statistics: mean, median, standard deviation of all days in data

Usage

intradaycv(df)

Arguments

df

Data frame read through readfile

Value

A data frame containing the mean, median, and standard deviation of the intraday coefficients of variation.

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
intradaycv(mydata)

Compute Intraday Standard Deviation

Description

This function computes the intraday standard deviation summary statistics: mean, median, standard deviation of all days in data

Usage

intradaysd(df)

Arguments

df

Data frame read through readfile

Value

A data frame containing the mean, median, and standard deviation of the intraday standard deviations.

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
intradaysd(mydata)

Compute J-index

Description

This function computes J-index, a glycemic variability metrix

Usage

J_index(df)

Arguments

df

Data frame read through readfile

Value

A numeric value representing J-index

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
J_index(mydata)

Compute Low Blood Glucose Index

Description

This function computes the low blood glucose index

Usage

LBGI(df)

Arguments

df

Data frame read through readfile

Value

A numeric value representing LBGI

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
LBGI(mydata)

Compute Low Blood Glucose Index

Description

This function computes the low blood glucose index

Usage

LBGI_HBGI(df)

Arguments

df

Data frame read through readfile

Value

A data frame containing both the LBGI and HBGI values

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
LBGI_HBGI(mydata)

Compute Mean of Glycemic Excursions

Description

This function computes the mean of glycemic excursions, glycemic excursions indicated by standard deviation, default = 1

Usage

MGE(df, sd = 1)

Arguments

df

Data frame read through readfile

sd

Standard deviation indicating glycemic excursion, default = 1

Value

A numeric value representing MAGE

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
MGE(mydata)

Compute Mean of Normal Glucose

Description

This function computes the mean of normal glucose, glycemic excursions indicated by standard deviation, default = 1

Usage

MGN(df)

Arguments

df

Data frame read through readfile

Value

A numeric value representing MGN

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
MGN(mydata)

Plot Glucose Data

Description

This function plots glycemic excursions over the time period in which data was collected.

Usage

plot_glucose(df)

Arguments

df

Data frame read through readfile

Value

None

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
plot_glucose(mydata)

Compute Percent of Time Outside Range

Description

This function computes the percent of time outside range (range in standard deviations from mean, default = 1).

Usage

POR(df, sd = 1, sr = 5)

Arguments

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)

Value

A numeric value representing POR

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
POR(mydata, sd = 1, sr = 5)

Read in Data Frame

Description

This function reads in a .csv with variable names Timestamp..YYYY.MM.DDThh.mm.ss and Glucose.Value..mg.dL

Usage

readfile(filename)

Arguments

filename

.csv file of data frame to be read

Value

transformed data frame for further analysis

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
readfile(mydatafile)

Compute Glucose Summary Statistics

Description

This function computes the mean, median, minimum, maximum, first quartile, and the third quartile of an indidividual's overall glucose levels

Usage

summary_glucose(df)

Arguments

df

Data frame read through readfile

Value

A dataframe containing the mean, median, minimum, maximum, quartile1, and quartile3 of glucose levels

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
summary_glucose(mydata)

Compute Time Inside Range

Description

This function computes the time inside range (range in standard deviations from mean, default = 1).

Usage

TIR(df, sd = 1, sr = 5)

Arguments

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)

Value

A numeric value representing TIR

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
TIR(mydata, sd = 1, sr = 5)

Compute Time Outside Range

Description

This function computes the time outside range (range in standard deviations from mean, default = 1).

Usage

TOR(df, sd = 1, sr = 5)

Arguments

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)

Value

A numeric value representing TOR

Examples

mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
mydata <- readfile(mydatafile)
TOR(mydata, sd = 1, sr = 5)