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 below example illustrates a potential bug found with group_by.dtplyr_step, please see this stackoverflow question for workarounds.
I'd like to group_by across several variables in dtplyr within a lapply loop, and I find that I somehow can't use the same syntax as dplyr after calling lazy_dt().
Thanks for the bug report! It looks like this is fixed in the development version, since #318. I'll close this now, but will reopen if you install using devtools::install_github("tidyverse/dtplyr") and still see a problem.
Reprex using v1.12.1 (current CRAN version)
devtools::load_all('~/Documents/GitHub/dtp')
#> ℹ Loading dtplyr#> Warning: package 'testthat' was built under R version 4.1.2
library(dplyr, warn.conflicts=FALSE)
fun<-function(df, x) {
df %>% group_by(across(all_of(x)))
}
lazy_dt(data.frame(a=1)) %>%
fun('a')
#> Error in `dt_squash_across()` at dtp/R/tidyeval.R:88:4:#> Caused by error in `all_of()`:#> ! object 'x' not found
Created on 2022-08-07 by the reprex package (v2.0.1.9000)
devtools::load_all('~/Documents/GitHub/dtp')
#> ℹ Loading dtplyr#> Warning: package 'testthat' was built under R version 4.1.2
library(dplyr, warn.conflicts=FALSE)
fun<-function(df, x) {
df %>% group_by(across(all_of(x)))
}
lazy_dt(data.frame(a=1)) %>%
fun('a')
#> Source: local data table [1 x 1]#> Groups: a#> Call: `_DT1`#> #> a#> <dbl>#> 1 1#> #> # Use as.data.table()/as.data.frame()/as_tibble() to access results
Created on 2022-08-07 by the reprex package (v2.0.1.9000)
The below example illustrates a potential bug found with group_by.dtplyr_step, please see this stackoverflow question for workarounds.
I'd like to group_by across several variables in dtplyr within a lapply loop, and I find that I somehow can't use the same syntax as dplyr after calling lazy_dt().
Using the same syntax, I encounter an issue after calling lazy_dt with dtplyr.
This was answered with workarounds at https://stackoverflow.com/q/73267732/5224236
The text was updated successfully, but these errors were encountered: