Sometimes the timestamp is provided as a single double, not a vector
This commit is contained in:
@@ -89,8 +89,12 @@ SEXP R_TimestampExt(int64_t ts)
|
||||
|
||||
int64_t R_TimestampUnix(SEXP r_ts)
|
||||
{
|
||||
if (TYPEOF(r_ts) == REALSXP) {
|
||||
return (int64_t)(Rf_asReal(r_ts) / 1);
|
||||
} else {
|
||||
return (int64_t)(Rf_asReal(VECTOR_ELT(r_ts, 0)) / 1);
|
||||
}
|
||||
}
|
||||
|
||||
int64_t R_TimestampExtUnix(SEXP r_ts)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user