On 26 January 2010 at 20:25, Romain Francois wrote:
| What about something like :
|
| class Rcpp::Date similar to RcppDate.
|
| and :
|
| as<Date>(SEXP)
| as<vector<Date>>(SEXP)
| wrap<Date>(const Date& date)
| wrap<vector<Date>>(const vector<Date>& date)
Yes. That is probably desirable.
| and maybe perhaps also:
|
| as<time_t>(SEXP)
| as<vector<time_t>>(SEXP)
| wrap<time_t>( const time_t& t)
| wrap<vector<time_t>>( const vector<time_t>& t)
That is trickier. 'time_t' stops at second resolution, POSIXct uses just one
double yet also managed microsecond granularity thanks to BDR. R is
non-standard here so it is tricky to mesh that with C++. In some
applications I simply kept time as a fractional double at the C++ level and
simply casted it to POSIXct once at the R level.
TZ transitions and accidentally dropping TZ can be tiocky.