warp.time: Transform time according to a given warping function

Description Usage Arguments Value Author(s) References Examples

View source: R/wccStick.R

Description

Warp time points according to a warping function.

Usage

1

Arguments

tp

A vector of time points, not necessarily equidistant.

coef

The coefficients of the parametric time warping function: the first coefficient is the constant shift, the second the linear stretch etcetera.

Value

The function returns a vector of warped time points.

Author(s)

Ron Wehrens

References

Wehrens, R. et al. (2015) "Fast parametric warping of peak lists", Bioinformatics. DOI: 10.1093/bioinformatics/btv299.

Examples

1
2
3
time <- 1:100
## simple shift and compression
warp.time(time, c(-10, .99))

Example output

  [1] -9.01 -8.02 -7.03 -6.04 -5.05 -4.06 -3.07 -2.08 -1.09 -0.10  0.89  1.88
 [13]  2.87  3.86  4.85  5.84  6.83  7.82  8.81  9.80 10.79 11.78 12.77 13.76
 [25] 14.75 15.74 16.73 17.72 18.71 19.70 20.69 21.68 22.67 23.66 24.65 25.64
 [37] 26.63 27.62 28.61 29.60 30.59 31.58 32.57 33.56 34.55 35.54 36.53 37.52
 [49] 38.51 39.50 40.49 41.48 42.47 43.46 44.45 45.44 46.43 47.42 48.41 49.40
 [61] 50.39 51.38 52.37 53.36 54.35 55.34 56.33 57.32 58.31 59.30 60.29 61.28
 [73] 62.27 63.26 64.25 65.24 66.23 67.22 68.21 69.20 70.19 71.18 72.17 73.16
 [85] 74.15 75.14 76.13 77.12 78.11 79.10 80.09 81.08 82.07 83.06 84.05 85.04
 [97] 86.03 87.02 88.01 89.00

ptw documentation built on Dec. 1, 2019, 1:12 a.m.