Create a gist now

Instantly share code, notes, and snippets.

Advanced R, Abridged

Advanced R, Abridged

"Advanced R" by Hadley Wickham is widely considered the best resource to improve your knowledge at R. However, going through it and answering every exercise takes a long time. This guide is designed to give you the most essential parts of Advanced R so that you can get going right away. It still will take a long time, but not as long.

--

1.) Quickly skim these chapters (without doing the exercises) to make sure you're familiar with the concepts:

2.) Read about Debugging, an important skill:

3.) Hadley co-authored "R for Data Science". Read these two chapters and do all the exercises in them:

4.) Read the following chapters of "Advanced R":

5.) Read on magrittr (%>%) here and here.

6.) Make a function that takes another function and returns a function that will print all the arguments and then run the orginal function.

add <- function(x, y) x + y
fn <- arg_printer(add)
fn(2, 3)
[1] "I was called with 2 and 3."
[1] 5

7.) Make a function errors_are_nas that takes an expression and returns an NA if that expression fails instead of an error.

8.) Optional Read these chapters:

9.) Optional Read on R6 classes. Try constructing a bank account class with deposit, check balance, and withdraw methods.

10.) Optional Learn about git, R Packages, and writing readable code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment