interpolate | R Documentation |
Wrapper function to interpolate a time series. If groups are specified, each group is processed separately. The time points of each group are supposed to be in chronological order.
interpolate(x, interval = NA, time.index = NA, time.vector = c(), method = "stineman", groups = c(), negzero = FALSE)
x |
the time series matrix, rows are objects and columns are time points |
interval |
the target intervals to be present after interpolation |
time.index |
the row index holding time points |
time.vector |
the vector holding time points |
method |
fmm, periodic, natural, hyman or monoH.FC (spline), scaledstineman, stineman or parabola (stinterp) |
groups |
a vector with group assignments and as many entries as there are samples |
negzero |
set negative values (can be introduced by interpolation) to zero |
If no interval is provided, the intervals in the time vector are computed and the most frequent one is taken as the interval. The default interpolation method is stineman. Note that interpolation can introduce negative values in the abundance matrix.
interpolated time series
data("david_stoolA_otus") data("david_stoolA_metadata") days=david_stoolA_metadata[1,] sorted=sort(apply(david_stoolA_otus,1,sum),decreasing=TRUE,index.return=TRUE) davida.top=david_stoolA_otus[sorted$ix[1:100],] tsplot(interpolate(davida.top,time.vector=days))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.