tidyverse / dtplyr

Data table backend for dplyr
https://dtplyr.tidyverse.org
Other
670 stars 57 forks source link

dumbbell package fails if dtplyr is attached #371

Closed hadley closed 2 years ago

hadley commented 2 years ago
library(dumbbell)
library(dtplyr)
library(dplyr, warn.conflicts = FALSE)

df <- data.frame(
  Subject = c("1", "10", "11", "12", "13", "14"),
  x = c("a", "a", "b", "b", "b", "b"),
  y1 = c(65276L, 36222L, 20894L, 67367L, 31533L, 1100L),
  y2 = c(86052L, 43051L, 60340L, 45732L, 50611L, 36501L)
)

dumbbell(df, id = "Subject", key = "x", column1 = "y1", column2 = "y2")
#> Error in UseMethod("gather"): no applicable method for 'gather' applied to an object of class "c('dtplyr_step_mutate', 'dtplyr_step')"

Created on 2022-07-05 by the reprex package (v2.0.1)

Any idea what might be going on here?

hadley commented 2 years ago

Ooooh because dumbbell uses dplyr functions on a data.table, and loading dtplyr causes it to use a different implementation. I thought we had an open issue about this but I can't seem to find it.

markfairbanks commented 2 years ago

Yep - here's the issue: https://github.com/tidyverse/dtplyr/issues/312