Learn R Programming

rGV (version 0.0.5)

cgm_auc: Calculate area under the curve (AUC)

Description

Calculate area under the curve (AUC)

Usage

cgm_auc(x, times, thresh = 100, above = TRUE)

Value

The numeric area under the curve value for a given dataset of glucose measurements and times.

Arguments

x

vector of glucose readings

times

vector of corresponding times, in minutes

thresh

threshold above (or below) which you wish to calculate the AUC. Default is 100.

above

logical indicating whether you wish to calculate area above the threshold value (TRUE) or below it (FALSE). Default is TRUE.

Examples

Run this code
cgm_auc(x=c(rep(100, 10), rep(120, 10), 105, 85), times=seq(0, 1260, 60), thresh=110, above=TRUE)

Run the code above in your browser using DataLab