A new small package with a new C++ header library is now on CRAN. It brings the date library by Howard Hinnant to R. This library has been in pretty wide-spread use for a while now, and adds to C++11/C++14/C++17 what will be (with minor modifications) the ‘date’ library in C++20. I had been aware of it for a while, but not needed thanks to CCTZ library out of Google and our RcppCCTZ package. And like CCTZ, it builds upon std::chron adding a whole lot of functionality and useability enhancement. But a some upcoming (and quite exciting!) changes in nanotime required it, I had a reason to set about packaging it as RcppDate. And after a few days of gestation and review it is now available via CRAN.
Two simple example files are included and can be accessed by
Rcpp::sourceCpp(). Some brief excerpts follow.
The first example shows three date constructors. Note how the month (and the leading digits) are literals. No quotes for strings anywhere. And no format (just like our anytime package for R).
A second example constructs the last day of the months similarly:
For more, see the copious date.h documentation.
The (very bland first) NEWS entry (from a since-added NEWS file) for the initial upload follows.
Changes in version 0.0.1 (2020-01-17)
- Initial CRAN upload of first version