Advice on taking your next steps in learning R

For the time being, I have developed this workshop to be standalone.

I sincerely hope though that the exercises within the workshop have whetted your appetite to learn more about how to use R as a platform for organising, managing, visualising and/or analysing your data and disseminating your findings as Open Science/Research.

To help you on this journey, I’ve compiled a list of ‘highly recommended’ resources below that could be useful for you to check out in future independent learning. I’ve tiered these in terms of things you could get into quite quickly and some materials that you might want to make a longer-term investment in.

1. Learning more about RMarkdown and R programming basics

In section [7.2.3.3. Emphasis] I already mentioned that Chester Ismay has a really good introductory online ‘book’ that covers the basics of RMarkdown. It’s called Getting Used to R, RStudio, and R Markdown. In particular, it’s useful if you want to explore more the functionality of RMarkdown. However, in later chapters he also:

  • Gives an Intro to R using RMarkdown, which goes through some of the basic programming principles you need to understand when first learning to code in R. These exercises will cover a few more thing than we’ve had time to cover in this workshop, so may prove invaluable to you.
  • Gives some advice on Deciphering Common R Errors, and links to some other blogs on this subject that offer good advice too. A lot of the time learning in R is a process of making errors and then spending time developing an understanding why your code hasn’t run, using the Error message to help infer what’s gone wrong. After a while you’ll get quite good at this and less irritated by the fact things typically don’t ‘go right first time’!

2. Building your Data Management and Visualisation Skills

As mentioned earlier, most researchers that have learned how to use R in the last decade or so have done so whilst making use of Hadley Wickham’s tidyverse packages, which make the programming of R more intuitive and user friendly.

He has a great book with lots of activities and exercises within it called R for Data Science, which is freely available as an open access online book. If I could only recommend one resource this would be THE book I’d suggest someone with no experience of programming who wants to start with, as they begin to learn how to use R. It gets you up to speed on how to use the tidyverse packages, which offer some great tools for visualising and ‘tidying’ your data (i.e. ggplot2 and tidyr, respectively). In R4DS’s later chapters it even starts to introduce some statistical modelling concepts too.1

3. Using R to do Statistical Analyses

There’s a several specific packages, courses and textbooks that I think are really good ways of getting yourself up-skilled in doing various types of analysis in R. I am by no means aware of every package or teaching text that exists in relation to #RStats.2

Below is simply a list of some I’ve either used and found valuable or that come ‘highly recommended’ from my past project and PhD students.

  • Firstly, if you liked Chester Ismay’s introductory online book (mentioned in section [8.1 Learning more about RMarkdown and R programming basics]) he also has one that covers some of the basics of statistical analysis in R, called ModernDive. Again, it’s completely free and open access .3 It’s relatively short and, like R for Data Science, it doesn’t get deep into ‘advanced’ stats, only going as far as multiple regression.
  • For a much broader and comprehensive package for teaching you statistical methods you could check out Andy Field’s Adventr package. The package was created as a series of interactive tutorials that you can run within R that go alongside his 2016 textbook: An Adventure in Statistics: the reality enigma. The package is free, as are the tutorials within it, and some of my past PhD students recommended this as a good introductory text for doing stats in R. Andy’s textbook obviously isn’t free though!4
  • Lastly, there may come a time when your interest in statistics leads you beyond ‘traditional’ frequentist (Null Hypothesis Significance Testing) approaches and into the world of Bayesian Modelling. If that happens, then R is really the best package to use and the best introductory textbook I’ve found on these methods is called Statstical Rethinking, by Richard McElreath. His lectures are on youtube too (if you fancy watching rather than reading) and his online materials to support his teaching, which basically goes through his book’s content, I’ve also found really accessible too!

  1. Mostly, it covers the basics of linear regression modelling.↩︎

  2. There are well over 10,000 R packages on the CRAN server, available for you to download. Only a proportion of them will be packages for doing statistical modelling. However, if you think that some of these packages are almost equivalent in scope to the functionality paid-for stats packages, like SPSS, offer, you quickly begin to the realise the increased potential R offers you.↩︎

  3. Hopefully you’re noticing a theme here!↩︎

  4. If you want the back-story of how I got interested in R, I first learned statistics largely in SPSS, drawing heavily on Andy Field’s then seminal textbook: Discovering Statistics Using SPSS, which is now on its 6th edition. However, during my PhD I would frequently find myself running into brick walls when reading sections of that textbook. Andy would allude to certain ‘robust’ analyses being extremely useful alternatives to more bog-standard ones that I was finding I couldn’t use because my data unhelpfully violated various assumptions. Only, Andy explained that SPSS couldn’t help me run any of these new-fangled analyses. Instead, I was advised that I’d have to learn how to run them in a (at the time) “new on the scene” stats software called R. What is more, Andy then released a textbook in 2012 called Discovering Statistics Using R, which was basically an expanded version of his original SPSS textbook, with extra sections added in all the places where I’d previously found dead-ends because R trumped SPSS in being able to run the robust methods. Need I say more – at that point I was 100% converted!🤩↩︎