You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The decision was taken to convert to UTC when two different posixct columns are joined. Indeed, the timezone is often only used for presentation, but some functions such as lubridate::year() work on the current timezone. Therefore such a decision could have an impact.
There is a warning if factors and characters are joined. It would be convenient to have a similar warning if the timezones don't match.
library(tidyverse)
#> Loading tidyverse: ggplot2#> Loading tidyverse: tibble#> Loading tidyverse: tidyr#> Loading tidyverse: readr#> Loading tidyverse: purrr#> Loading tidyverse: dplyr#> Conflicts with tidy packages ----------------------------------------------#> filter(): dplyr, stats#> lag(): dplyr, statstib_cet<- tibble(date= ISOdate(2016,1,1,0:2, tz='CET'), val_cet= runif(3))
tib_eet<- tibble(date= ISOdate(2016,1,1,0:2, tz='EET'), val_cet= runif(3))
tib_utc<- tibble(date= ISOdate(2016,1,1,0:2, tz='UTC'), val_utc= runif(3))
lubridate::year(tib_cet$date)
#> [1] 2016 2016 2016lubridate::year(tib_eet$date)
#> [1] 2016 2016 2016lubridate::year(tib_utc$date)
#> [1] 2016 2016 2016tib_join<- left_join(tib_cet, tib_utc, by='date')
lubridate::year(tib_join$date) # UTC is the convention but I would assume that the convention is on the left table#> [1] 2015 2016 2016tib_join<- left_join(tib_cet, tib_eet, by='date')
lubridate::year(tib_join$date) # This is even stranger since the UTC assumption is used in neither of the two tables#> [1] 2015 2016 2016
Such issues go unnoticed. Certainly since I would assume that the timezone of the left hand table would be dominant.
The text was updated successfully, but these errors were encountered:
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
lockbot
locked and limited conversation to collaborators
Nov 7, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This relates to this issue: #2643
The decision was taken to convert to UTC when two different posixct columns are joined. Indeed, the timezone is often only used for presentation, but some functions such as
lubridate::year()
work on the current timezone. Therefore such a decision could have an impact.There is a warning if factors and characters are joined. It would be convenient to have a similar warning if the timezones don't match.
Such issues go unnoticed. Certainly since I would assume that the timezone of the left hand table would be dominant.
The text was updated successfully, but these errors were encountered: