Skip to contents

Warps a supplied vector time-series or data.frame using a warp transformation.

Usage

warp(x, trans = 1, ...)

Arguments

x

vector time-series or data.frame, to be warped

trans

numeric vector the warp transformation to apply to x.

...

Other arguments, currently ignored.

Value

x warped, by default a data.frame.

Note

warps are not conservative.

See also

Author

Karl Ropkins

Examples

x <- 1:1000
plot(x, type = "l", main = "Simple Warping")
#transformations < 1 compress time-series
lines(warp(x, 0.5), col = "red")
#transformations > 1 expand time-series
#to expand and the compress, and end at original end value
#   mean(transformation) should equal 1
lines(warp(x, c(1.75, 0.25)), col = "blue")
legend(725, 350, c("0.5", "1.75, 0.25"),
       col=c("red", "blue"), lty=1, cex=0.75)