Learn R Programming

CGManalyzer (version 1.3.1)

equalInterval.fn: 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)

Value

a matrix with equally spaced time sequence and corresponding signal value

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

Author

Xiaohua Douglas Zhang

Details

Function to derive the data with equal interval for a timeseries

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

Run this code
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

Run the code above in your browser using DataLab