How to safely import timestamps with Nanosecond precision

ぐ巨炮叔叔 提交于 2021-02-11 06:10:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!