Problem with bind_rows(..., .id) and yearqtr

218 Views Asked by At

Recent versions of dplyr can bind_rows even with classes like yearqtr. However, I am having a problem when I also use the .id parameter. For example:

library(dplyr) # dplyr_1.0.6, vctrs_0.3.8 
bind_rows(a = tibble(d = as.Date('2000-1-1')), b = tibble(d = as.Date('2000-1-1')), .id = 'Id') # Ok
library(zoo) # zoo_1.8-9
bind_rows(a = tibble(d = as.yearqtr('2000q1')), b = tibble(d = as.yearqtr('2000q1'))) # Ok
bind_rows(a = tibble(d = as.yearqtr('2000q1')), b = tibble(d = as.yearqtr('2000q1')), .id = 'Id') # Problem

The problem with the last line is that the d column ends up a strange class, vctrs:::common_class_fallback instead of the expected yearqtr class.

Edit: Is this a bug?

0

There are 0 best solutions below