# NOT RUN {
set.seed(42)
n <- 50
t <- seq_len(n)
xy <- (1 + 0.6 * sin(t*0.025)) * sin(t*0.2) + 2 * sin(t*0.025) +
rnorm(n, sd = 0.5)
inter_dt <- round(runif(length(xy), min = 0.5, max = 1.5), 1)
dt <- cumsum(inter_dt)
res <- respace(xy = xy, dt = dt)
opar <- par("mfrow")
par(mfrow = c(1,1))
plot(res$xy, res$dt, type = "l")
points(res$xy[res$initial], res$dt[res$initial], pch = 19, col = "green")
points(res$xy[!res$initial], res$dt[!res$initial],
pch = 19, col = "red", cex = 0.5)
par(mfrow = opar)
# }
Run the code above in your browser using DataLab