mablab / sftrack

sftrack: Modern classes for tracking and movement data
https://mablab.org/sftrack/
Other
53 stars 2 forks source link

How should sftrack deal with fractional seconds? #21

Closed birderboone closed 2 years ago

birderboone commented 4 years ago

Many tracking devices record in fractional seconds. While some (like gps) do not require that sort of time resolution, some technologies like accelerometers require it at the tenth of a second.

R famously does not treat fractional seconds very well, its format.posix** will round the value with some 'fudge' buffer thats not always well understood. While the fractional second value is intact, the display of it and therefore the conversion of the unit can be easily lost.

https://stackoverflow.com/questions/7726034/how-r-formats-posixct-with-fractional-seconds

What are the best techniques (packages include) that deal with fractional seconds in R? What is the default display accuracy for sftrack. And should it include special wrapper options to change the display seconds options (options('digits.secs') I believe).

I can post more links, this is a problem ive had on my mind but havent looked into enough

basille commented 4 years ago

My hunch is that we leave it to R to deal with it, until we are provided concrete reproducible examples where it becomes a limiting issue. The SO discussion linked above provide good workarounds for most situations, I feel it would be way beyond the scope of the package to try to "fix" this instead of R.

Same for default display accuracy for sftrack: let there be none — this is R responsibility, and users might want to deal with it at this level.

basille commented 2 years ago

Closing this issue now that sftrack is developed and on CRAN.