equalInterval.fn {CGManalyzer} | R Documentation |
Function to derive the data with equal interval
equalInterval.fn(x, y, Interval = NA, minGap = 4 * Interval)
x |
time sequence |
y |
measured response |
Interval |
interval indicating equal space between two consecutive points |
minGap |
the length of a chain of continuous missing values in which the missing values will not be derived from the neighbor points |
Function to derive the data with equal interval for a timeseries
a matrix with equally spaced time sequence and corresponding signal value
Xiaohua Douglas Zhang
Zhang XD, Zhang Z. CGManalyzer: a R package for analyzing continuous glucose monitoring studies
data.mat <- cbind( "timeSeries"=c(0, 3, 6, 9, 11, 21, 24, 27, 33, 38, 39, 42), "signal"=c(3.930, 3.973, 4.005, 4.110, 4.164, 4.165, 4.186, 4.265, 4.266, 4.357, 4.503, 4.690) ) dataEqualSpace.mat <- equalInterval.fn(x=data.mat[,1], y=data.mat[,2], Interval=3) data.mat dataEqualSpace.mat