edzer / trajectories

Handling and analyzing trajectory and movement data
31 stars 15 forks source link

issue with "findPoints" #8

Closed Moradii closed 7 years ago

Moradii commented 7 years ago

Line 80: tdiff1 <- tr1$time[i] - tr2$time[iv] needs to be replaced by tdiff1 <- difftime(tr1$time[i],tr2$time[iv])

Line 81: tdiff2 <- tr2$time[iv+1] - tr2$time[iv] needs to be replaced by tdiff2 <- difftime(tr2$time[iv+1],tr2$time[iv],units = units(tdiff1))

In the current code, tdiff1 and tdiff2 may be found by two different units e.g. secs or mins and as a result "ratio" will get a wrong value and it affects final result.

edzer commented 7 years ago

Thanks, Mehdi, well spotted!