Closed
Description
Code that used to work in current CRAN release 0.8.3, does not work anymore in recent devel.
Clean R environment, just installed cran remotes
and github dplyr
, as of 30m ago.
There seems to be a breaking change in the way how .dots
argument is processed(?). I haven't found any references in NEWS file regarding this.
suppressMessages(library(dplyr))
data.frame(a=1:2, b=2:3) %>% group_by(.dots = c("a","b")) %>% summarize(count = n())
#Error: The quosure environment should be explicitly supplied as `env`
#Run `rlang::last_error()` to see where the error occurred.
rlang::last_error()
#<error/rlang_error>
#The quosure environment should be explicitly supplied as `env`
#Backtrace:
# 1. base::data.frame(a = 1:2, b = 2:3)
# 9. dplyr::group_by(., .dots = c("a", "b"))
# 10. dplyr::group_by_prepare(.data, ..., .add = .add)
# 11. dplyr:::compat_lazy_dots(.dots)
# 12. dplyr:::compat_lazy(dots[[i]], env, warn)
# 13. rlang::parse_quo(lazy[[1]], env)
#Run `rlang::last_trace()` to see the full context.
rlang::last_trace()
#<error/rlang_error>
#The quosure environment should be explicitly supplied as `env`
#Backtrace:
# █
# 1. └─`%>%`(...)
# 2. ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
# 3. └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
# 4. └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
# 5. └─`_fseq`(`_lhs`)
# 6. └─magrittr::freduce(value, `_function_list`)
# 7. └─function_list[[i]](value)
# 8. ├─dplyr::group_by(., .dots = c("a", "b"))
# 9. └─dplyr:::group_by.data.frame(., .dots = c("a", "b"))
# 10. └─dplyr::group_by_prepare(.data, ..., .add = .add)
# 11. └─dplyr:::compat_lazy_dots(.dots)
# 12. └─dplyr:::compat_lazy(dots[[i]], env, warn)
# 13. └─rlang::parse_quo(lazy[[1]], env)
Activity
[-]group_by(.dots) handling breaking change?[/-][+]group_by(.dots) handling - breaking change?[/+]hadley commentedon Jan 11, 2020
Thanks for the bug report — I've fixed the bug and I'm about to make it clear that this argument is deprecated. I'll do a soft deprecation which means it shouldn't affect user group, but it will encourage downstream packages (like dbplyr!) to not use it; we'll move to a stronger deprecation at some point in the future.
group_by(.dots) is deprecated
tylerlittlefield commentedon Mar 18, 2021
I'm updating a package to remove usage of
.dots
the news file suggests!!!
. I was just curious if that is still the case or ifacross
might be preferred. I'm trying to decide which of the two examples I should use:hadley commentedon Mar 18, 2021
@tyluRp either is fine.