New R Interface
15 Feb 2020
Leonardo Silvestri

The first version of the interface to ztsdb, rztsdb, has an unsatisfactory interface to R. Times in ztsdb are implemented as 64-bit integers with nanosecond precision, but they are mapped to POSIXct thus imposing a potential precision loss. Also, ztsdb has a rich representation of time (e.g. intervals, periods, durations) and these new temporal types had no correspondence in R.

To bring a remedy to this state of affairs, the nanotime package is being enhanced with these new types. Additionally, a new package, dtts.utils is being developed that provides functionality for time-series with nanotime index. These time-series are not a new type, but they are simply data.table instances whose first column is a nanotime vector. It is thus now possible to leverage the full power of data.table.

rztsdb is currently being modified to incorporate all these changes so that ztsdb will have the tight integration with R that was initially imagined.