Closed
Description
When using dplyr's group_by function and the base's sum function with the parameter na.rm=TRUE, dtplyr is unable to appropriate translate into data.table lingo.
library(data.table)
library(dtplyr)
library(dplyr,warn.conflicts=FALSE)
packageVersion("data.table")
#> [1] '1.12.8'
packageVersion("dtplyr")
#> [1] '1.0.0.9000'
x1 <- data.frame(x = 1:3, y = c(1,1,2))
x1 %>%
lazy_dt() %>%
group_by(y) %>%
summarise(sum=sum(x,na.rm=T)) %>%
ungroup() %>%
as_tibble()
#> Error in eval(jsub[[ii]][[3L]], parent.frame()): object '..T' not found
x1 %>%
lazy_dt() %>%
group_by(y) %>%
summarise(sum=sum(x,na.rm=T)) %>%
ungroup()
#> Source: local data table [?? x 2]
#> Call: `_DT2`[, .(sum = sum(x, na.rm = ..T)), keyby = .(y)]
#> Error in eval(jsub[[ii]][[3L]], parent.frame()): object '..T' not found
Created on 2020-01-14 by the reprex package (v0.3.0)