0.7 Some R pointers

A question we get asked fairly regularly is ‘what’s the best/easiest way to learn R?’. Unfortunately, we don’t have a ready answer to this question as everyone tends to learn R in their own way and at their own pace. Having said that, here are a few things to bear in mind that might help:

  • Use R often and use it regularly - find any excuse to fire up RStudio (or just R) and get coding. This will help build and maintain all important momentum.

  • Learning R is not a memory test. One of the beauties of a scripting language is that you will always have your code to refer back to when you inevitably forget how to do something.

  • You don’t need to know everything there is to know about R to use it productively. If you get stuck, Google it, it’s not cheating and writing a good search query is a skill in itself. Just make sure you check thoroughly that the code you find is doing what you want it to do.

  • If you find yourself staring at code for hours trying to figure out why it’s not working then walk away for a few minutes. We’ve lost count of the number of times we were able to spot our mistake almost immediately after returning from a short caffeine break.

  • In R there are many ways to tackle a particular problem. If your code doesn’t look like someone else’s, but it does what you want it to do, in a reasonable time and robustly then don’t worry about it - job done.

  • Related to our previous point, remember R is just a tool to help you answer your interesting questions. Although it can be fun to immerse yourself in all things R (we often do), don’t lose sight of what’s important - your research question(s) and your data. No amount of skill using R will help if your data collection is fundamentally flawed or your question vague.

  • Recognise that there will be times when things will get a little tough or frustrating. Try to accept these periods as part of the natural process of learning a new skill (we’ve all been there) and remember, the time and energy you invest now will be more than recouped in the not too distant future.

Finally, once you’ve finished working your way through this book, we encourage you to practice what you’ve learned using your own data. If you don’t have any data yet, then ask your colleagues / friends / family for some (we’re sure they will be delighted!) or follow one of the many excellent tutorials available online (see the course website for more details). Our suggestion to you, is that while you are getting to grips with R, uninstall any other statistics software you have on your computer and only use R. This may seem a little extreme but will hopefully remove the temptation to ‘just do it quickly’ in a more familiar environment and consequently slow down your learning of R. Believe us, anything you can do in your existing statistics software package you can do in R - often more robustly and efficiently.

Good luck and don’t forget to have fun.