问题
I’ve discovered this morning that bulk of timestamp formats in R seem to be posix.ct class based, which seems to be risky for use with nano second timestamps due to rounding and accumulation errors. Is this true?
If so, What packages and processing steps are needed to safely import timestamps in nano seconds precision - probably from csv files? (Preferably staying with packages within tidyverse)
Output Visual tools used currently are ggplot2 , plotly, and d3
回答1:
We wrote a package for that: nanotime
It relies on the standard 'numer of nanoseconds since epoch stored in an in int64' representation, and package bit64 supplies the integer64
type. Internally package RcppCCTZ is used for some of the parsing and formatting and more. And one package that already works well with integer64
and hence our nanotime
objects is data.table.
来源:https://stackoverflow.com/questions/64506945/how-to-safely-import-timestamps-with-nanosecond-precision