Writing Better R Code
Data scientists, analysts, and statisticians are passionate about the data, models, and insights but the code used to produce the results (in many cases) is left behind. We have very good understanding of our code base during the time when we are working on the project but most of the time we do not write the code for the "future me".
In this talk, I describe and explain common coding pitfalls in R and then introduce functional programming using functions from base R, purrr (part of tidyverse) and pipes as a preferred solution for creating robust and reusable R code. Between the topics, I briefly touch on controversial topics such as "loops are bad" and "pipes are the best"
Outline/Structure of the Talk
“C” like language TRAP: If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck R-duck
(Too) Flexible Subsetting: The biggest secret of R is that vector indexing "operators" are functions
Troublesome (for-)loops: loops are good - let's hide them!
Functional programming: pipes and function factories
You will learn about common R pitfalls and how to avoid them.
If you have a "love–hate relationship" with R or you would like to bring your R skills to the next level then you should definitely attend this session.
Prerequisites for Attendees
Even beginners can learn a lot from this talk but you should have some R coding experience.