View source: R/equalInterval.fn.R
equalInterval.fn | 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, Wang D. 2018. CGManalyzer: an R package for analyzing continuous glucose monitoring studies. Bioinformatics 34(9): 1609-1611 (DOI: 10.1093/bioinformatics/btx826).
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.