jmsigner / amt

37 stars 13 forks source link

speed is not returning the results in m/s #62

Open LuisLauM opened 2 years ago

LuisLauM commented 2 years ago

speed function is not giving the outputs in m/s (as its documentation indicates). That is maybe because internally the funtion is calculating the steps without considering the lonlat = TRUE argument. I have tried changing the CRS value, but it is the same.

speed.track_xyt <- function(x, append_na = TRUE, ...) {
  stps <- suppressWarnings(steps(x))
  s <- stps$sl_ / as.numeric(stps$dt_, units = "secs")
  if (append_na) {
    c(s, NA)
  } else {
    s
  }
}