equalInterval.fn {CGManalyzer}R Documentation

Function to derive the data with equal interval

Description

Function to derive the data with equal interval

Usage

equalInterval.fn(x, y, Interval = NA, minGap = 4 * Interval)

Arguments

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

Details

Function to derive the data with equal interval for a timeseries

Value

a matrix with equally spaced time sequence and corresponding signal value

Author(s)

Xiaohua Douglas Zhang

References

Zhang XD, Zhang Z, Wang D. 2018. CGManalyzer: an R package for analyzing continuous glucose monitoring studies. Bioinformatics 34(9): 1609-1611 (DOI: 10.1093/bioinformatics/btx826).

Examples

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

[Package CGManalyzer version 1.3.1 Index]