Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Joins are too strict about tz attributes #2643
I think this is going to cause major pain for people
library(dplyr, warn.conflicts = FALSE) library(nycflights13) hourly_delay <- flights %>% group_by(time_hour, origin) %>% summarise(delay = mean(dep_delay, na.rm = TRUE)) hourly_delay %>% inner_join(weather, by = c("time_hour", "origin")) #> Error in inner_join_impl(x, y, by$x, by$y, suffix$x, suffix$y, accept_na_match): attributes are different attributes(flights$time_hour) #> $class #>  "POSIXct" "POSIXt" #> #> $tzone #>  "UTC" attributes(weather$time_hour) #> $class #>  "POSIXct" "POSIXt" #> #> $tzone #>  ""
@zeehio would this be easy to fix?
@krlmlr could we get a better error message here? Ideally needs to give variable names on both sides of the join
The join logic goes through a different code path than the code paths I have worked with in the past (this is the third way I see to merge vectors in dplyr... I hope
A quick fix can be done at (
I believe that the best fix would be to make
Correction: ignore the "have the same time zone" constraint. If
The timezone is just used for visualization, as far as I understand. So if someone joined different timezones the merge would be fine and the result would be printed in UTC (the default).