ctmm-initiative / ctmm

Continuous-Time Movement Modeling. Functions for identifying, fitting, and applying continuous-space, continuous-time stochastic movement models to animal tracking data.
http://biology.umd.edu/movement.html
43 stars 10 forks source link

Possible improvement for distances() function error handling #56

Open jennyhansen opened 2 months ago

jennyhansen commented 2 months ago

When working with the distances function today, I ran into a perplexing error:

dist_test <- distances(list(telem_2015$W0720_2015, telem_2015$W1304_2015), list(models_2015$W0720_2015, models_2015$W1304_2015))

Error in as.POSIXlt.POSIXct(x, tz) : invalid 'tz' value

After a lot of trial and error, I realized that I had two values listed in the $timezone slot: 'CEST' and 'CET.' I was able to remove the second value manually and the distances() function ran without issue. I am not sure how common it is to have two values in the $timezone slot, but it might be worthwhile to add a more informative warning or error message if/when it happens.

chfleming commented 2 months ago

Those aren't the same timezones, right? How did two get in there? What do the original timestamps look like?