qfazille
5/23/2019 - 11:33 AM

helpers to get rid of dplyr notes

helpers to get rid of dplyr notes

When using dplyr in R package I'm often in trouble to get rid of notes. 
Here are equivalent between functions using tidyeval and not (and sometime R base equivalent) with minimal repro examples.

List of functions described :

- arrange (+ desc) : 01_arrange.R
- group_by : 02_group_by.R
# Arrange with desc

# with tidyeval
arrange(iris, desc(Sepal.Length))
  
# without tidyeval
arrange_at(iris, .funs = desc, .vars = vars("Sepal.Length"))
  
# base R
iris[order(iris$Sepal.Length, decreasing = TRUE),]
# group_by

# with tidyeval
zz <- group_by(iris, Species)

# without tidyeval
zz <- group_by_at(iris, .vars = vars("Species"))