commit ba0530a9b30d1bc33485ec69bb2efcfabf8f351a
parent 6f9ced6b2f8a4408b9e302cb1cf53756d856ee83
Author: eamoncaddigan <eamon.caddigan@gmail.com>
Date: Fri, 20 May 2016 16:39:38 -0400
Ha ha, oops.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/R/createTrajectory.R b/R/createTrajectory.R
@@ -72,7 +72,7 @@ createTrajectory <- function(longitude, latitude, altitude = 0, timestamp = NULL
distNM <- geosphere::distCosine(coords[1:(nCoord-1), ],
coords[2:nCoord, ],
r = 3444)
- groundspeed <- distNM / timestamp[1:(nCoord-1)] * 3600
+ groundspeed <- distNM / diff(timestamp) * 3600
groundspeed <- c(groundspeed, groundspeed[nCoord-1])
} else{
checkLength(groundspeed)