CGMS2DayByDay: Interpolate glucose value on an equally spaced grid from day...

View source: R/utils.R

CGMS2DayByDayR Documentation

Interpolate glucose value on an equally spaced grid from day to day

Description

Interpolate glucose value on an equally spaced grid from day to day

Usage

CGMS2DayByDay(data, dt0 = NULL, inter_gap = 45, tz = "")

Arguments

data

DataFrame object with column names "id", "time", and "gl". Should only be data for 1 subject. In case multiple subject ids are detected, a warning is produced and only 1st subject is used.

dt0

The time frequency for interpolation in minutes, the default will match the CGM meter's frequency (e.g. 5 min for Dexcom).

inter_gap

The maximum allowable gap (in minutes) for interpolation. The values will not be interpolated between the glucose measurements that are more than inter_gap minutes apart. The default value is 45 min.

tz

A character string specifying the time zone to be used. System-specific (see as.POSIXct), but " " is the current time zone, and "GMT" is UTC (Universal Time, Coordinated). Invalid values are most commonly treated as UTC, on some platforms with a warning.

Value

A list with

gd2d

A matrix of glucose values with each row corresponding to a new day, and each column corresponding to time

actual_dates

A vector of dates corresponding to the rows of gd2d

dt0

Time frequency of the resulting grid, in minutes

Examples


CGMS2DayByDay(example_data_1_subject)


irinagain/iglu documentation built on April 15, 2024, 4:20 p.m.