insert_NA_and_try_to_shift {pdt} | R Documentation |
insert_NA_and_try_to_shift
Description
Makes the input time series equidistant. This is recommended before performing a permutation distancing test. This function first inserts NA's for missing x_values, then it tries to shift double value to previous or next NA's, finally it aggregates the remaining identical x_values.
Usage
insert_NA_and_try_to_shift(x, x_values, y)
Arguments
x |
factor vector to indicate conditions or phases (e.g., "A" and "B") |
x_values |
numerical vector with distance (time markers) between observations |
y |
numeric vector with the observed y-values |
Value
List with the modified x, x_values, y: x = factor vector with conditions or phases (e.g., "A" and "B"). x_values = (optional) vector with distance (time markers) between observations. y = vector with observed values.
Examples
pdt::insert_NA_and_try_to_shift(as.factor(c("A","A","A","B","B","B")),
c(1,2,4,5,6,8), c(1.1,3.2,5.3,7.1,8.3,9.8))
[Package pdt version 0.0.2 Index]