ic3 ic3 - 1 month ago 12
R Question

Working with date and times in Renjin

I'm a bit lost, how can I pass to renjin an array of datetime (going though string would be really a pain). It can be a Joda or Java dateTime class or similar

I haven't found either a datetime type.

Answer Source

The R language doesn't have a special date/time vector type; there are a few different representations depending on how time is modelled:

  1. POSIXct: stored as double vector of class "POSIXct" with the number of seconds since Jan 1st 1970. See the PosixCtVector.Builder Java class for a convenient way of constructing an R object.

  2. POSIXlt: stored as a list of date-time component vectors. See PosixLtVector.Builder

  3. Date: stored as a double vector of class "Date" that contains the number of days since 1970-01-01 IIRC.