Revision ce60f670aac0a708d3a9af5f0cf46a752d46ba8a authored by John M Chambers on 28 October 2020, 07:59:48 UTC, committed by cran-robot on 28 October 2020, 07:59:48 UTC
1 parent 698183c
trackSpeed.R
trackSpeed <- function(coords, time) {
dt <- diff(as.numeric(time))
d2 <- diff(as.matrix(coords))^2
speed <- d2[,1]
ndim <- ncol(d2)
if(ndim > 1)
speed <- d2 %*% rep(1,ndim)
else
speed <- d2
sqrt(as.vector(speed))/dt
}
Computing file changes ...