I’ve previously posted about the benefits of the dplyr package for data manipulation and performing if/else functions, but I wanted to share this R-bloggers post by Markus Berroth. The post includes base R vs dplyr sample code to demonstrate how dplyr can make life easier for data scientists. The Abstract Syntax Tree (AST) illustrations are also super helpful for understanding what’s happening with your R code.
These type of AST visuals are all over Hadley Wickham’s Advanced R (Second Edition), and they’ve definitely helped me to better understand my R code. My copy of Wickham’s Advanced R has already seen plenty of my handwritten notes… I love a good physical book to reference on my bookshelf… but rest assured, it’s also available for free, in full, online!
- R-bloggers: Bang Bang - How to Program with dplyr, by Markus Berroth
- dplyr: A Grammar for Data Manipulation in R
- Tidyverse: A Collection of R Packages
Full version of Wickham’s Advanced R is also available online for free (licensed under Creative Commons):