This function takes cleaned CGM data and returns clinically relevant measures (e.g. percent time spent over 140, MAGE, MODD, etc.).
cgmvariables(inputdirectory,
outputdirectory = tempdir(),
outputname = "REDCap Upload",
aboveexcursionlength = 35,
belowexcursionlength = 10,
magedef = "1sd",
congan = 1,
daystart = 6,
dayend = 22,
format = "rows")
The directory containing cleaned CSV files for analysis.
The directory where you would like the results spreadsheet to be written.
The name of the file containing final CGM variables (without the file extension).
The number of minutes blood sugar must be above threshold to count an excursion.
The number of minutes blood sugar must be below threshold to count an excursion.
How large an excursion needs to be in order to count in the MAGE calculation (e.g. greater than 1 standard deviation).
CONGA interval in hours.
The numeric hour at which daytime should start (e.g. to start counting day time at 6:00am, set daystart = 6).
The numeric hour at which daytime should end (this parameter uses military time, so to stop counting day time at 10:00pm, set dayend = 22).
Whether observations are in rows or columns.
A data frame containing calculated CGM variables, with each column representing one CGM file.
All files must be saved as a csv, and must have three columns, the first of which contains the subject ID in the first cell and date of CGM placement in the second (see example files). The names of the columns must be "subjectid" "timestamp" and "sensorglucose" (without quotes) respectively. Files can be cleaned and formatted using this package's cleandata() function.
# NOT RUN {
cgmvariables(system.file("extdata","Cleaned",package = "cgmanalysis"))
# }
Run the code above in your browser using DataLab