echasnovski · GitHub

In current dplyr GitHub version (commit 792ca49 ) there is an inconsistent treatment of quosures in colwise verbs:

suppressPackageStartupMessages(library(dplyr))
library(rlang)
df <- mtcars[1:5, ]
transmute_at(df, vars(mpg), ~ . > mean(.))
#>     mpg
#> 1  TRUE
#> 2  TRUE
#> 3  TRUE
#> 4  TRUE
#> 5 FALSE
# This throws error "Object '.' is not found"
transmute_at(df, vars(mpg), quo(. > mean(.)))
#> Error in ~. > mean(.): объект '.' не найден
summarise_at(df, vars(mpg), ~ mean(.))
#>     mpg
#> 1 20.98
summarise_at(df, vars(mpg), quo(mean(.)))
#>     mpg
#> 1 20.98

Created on 2019-04-13 by the reprex package (v0.2.1)

And could you please tell me: by current design, should I be able to pass quosures in .funs? In docs it says that .funs can be "...a quosure style lambda ~ fun(.)...".

Read the original on github.com ↗