The goal of zones is to provide access to the C++ library, date. This is a developer focused package, useful for those that are building their own date and date-time R package, like clock.
To use the C++ API supplied by zones:
-
Add zones to both Imports and LinkingTo.
-
Call
zones::zones_initialize()
from your.onLoad()
. -
Access the date API through
#include <zones/*.h>
where*
is replaced with the date header you want to use.
Note that while zones/tz.h
declares many functions and types, most of
their implementations are not present in the header file. This means
that the functions in zones/tz.h
are not safe to call from your R
package. Instead, the most critical helpers have been exposed in a safe
way in zones/zones.h
. Use these instead.
You can install the released version of zones from CRAN with:
install.packages("zones")
And the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("r-lib/zones")