Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[Bug] CJ() looses timezone of POSIXct vector #2029
Closed
Comments
This comment has been minimized.
This comment has been minimized.
Can confirm this.
As far as I can tell the reason behind this is mentioned explicitly in the comments for the
Couldn't one simply re-apply the attributes of the input columns to the output columns after the Cartesian product has been constructed, right around line 356 in https://github.com/Rdatatable/data.table/blob/fb03ad184de08535e28d772dfe172f5ddf384a52/R/setkey.R? |
This was referenced May 8, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a problem when using CJ() with POSIXct objects.
If CJ is used to construct a data.table from a POSIXct vector with timezone UTC and a second grouping vector, the resulting POSIXct column in the data.table has local timezone.
If the POSIXct vector is the only input to CJ, the timezone is preserved.
Also, plain data.table() preserves the timezone.
See below for a reproducible example and my sessionInfo(). Maybe related to (#1778)
Here is my sessionInfo()
Kind regards,
Markus Bonsch