Testing dplyr 1.0.0

Packages R tidyverse

Finally getting around to trying out dplyr 1.0.0… Love it!

Javier Orraca (Scatter Podcast)
06-20-2020

I had read about the new across() function hype and now I get it… No more mutate_at() or summarise_at() with the cryptic list-lambdas. As the dplyr documentation states, “across() supersedes the family of”scoped variants" like summarise_at(), summarise_if(), and summarise_all()."

Below is an example highlighting the new across() syntax meant to be used within a mutate() function. I tried this on a few columns of the mtcars data set with dplyr’s case_when() a la SQL CASE_WHEN (as opposed to nesting multiple if_else() statements to the point of confusion!). The dplyr changes are subtle but will definitely streamline my data wrangling.

dplyr 1.0.0’s new across() function

Source:
* dplyr, a core tidyverse package

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Orraca (2020, June 20). Javier Orraca: Testing dplyr 1.0.0. Retrieved from https://www.javierorraca.com/posts/2020-06-20-dplyr-1.0.0/

BibTeX citation

@misc{orraca2020testing,
  author = {Orraca, Javier},
  title = {Javier Orraca: Testing dplyr 1.0.0},
  url = {https://www.javierorraca.com/posts/2020-06-20-dplyr-1.0.0/},
  year = {2020}
}