csgillespie / efficientR

Efficient R programming: a book
https://csgillespie.github.io/efficientR/
Other
721 stars 375 forks source link

deprecated standard evaluation in dplyr verbs such as "group_by_" #234

Closed ecosang closed 6 years ago

ecosang commented 6 years ago

Hi, like mutate_each, standard evaluation verbs such as group_by_ are also deprecated since dplyr 0.7.0. I replaced the deprecated examples with new versions. The two links are useful, so it might be helpful include them in the texts.

https://rpubs.com/hadley/dplyr-programming https://edwinth.github.io/blog/dplyr-recipes/

Although the intention of tidy_eval makes sense, still it is quite confusing. Not sure if the changing three lines of codes are enough for readers. I just want to give an example to update the code. Since this is the book it might be better to add some texts if it is necessary.

FYI, in the vignette (above links), the main purpose of this transition is to include the verbs into a function. Thus, if we include text character "cut(speed.. )" as an argument, rlang package is necessary, which is not included in the beginning of the chapter in the required package list. For simplying passing a single variable !!!sym("text") is used. !!! is equivalent to UQS, !! is UQ if I understand it correctly.

Thanks!

Robinlovelace commented 6 years ago

Yes tidyeval was not a concept in use when we wrote the book. Your suggested changes and comments are very welcome.