NC3Rs David Sainsbury Fellows Meeting: R Tutorial

This tutorial provides a basic introduction to the R statistical modelling and graphing environment. The basic goal is to demonstrate that scripting and analysis in a programming language like R is vastly superior to using spreadsheets (such as Excel). No assumptions are made about previous programming experience.

Learning objectives

After completing this tutorial you should:

  • be familiar with basic R commands and R Studio
  • be able to import, explore and manipulate your data in R
  • know how and where to get help and documentation
  • be capable of creating and modifying simple R scripts
  • seen how to create a beautiful plot using ggplot2

Prerequisites

To follow this course you need to have installed R and R Studio on your laptop. If you haven't already done so they can be downloaded (for free) from the links below:

Further preparation

The latter stages of the tutorial make use of some additional libraries. Instructions on how to install them are provided in the flow of the tutorial but if you want to be ahead of the curve you can install them before you start. Open R Studio and type the following command at the > prompt:

install.packages(c("ggplot2", "scales", "ggrepel", "ggthemes"))

You may be prompted to pick a 'mirror', any choice shuld work but picking the closest site to you is recommended.

Acknowledgments

Content of this tutorial built upon the following: