Description

R is one of the leading programming languages in Data Science. It is widely used to perform statistics, machine learning, visualisations and data analyses. It is an open source programming language so all the software we will use in the course is free. This course is an introduction to R designed for participants with no programming experience and it particularly focuses on learning to understand (your) data and how to communicate your data. We will start by briefly introducing programming in R and will teach you how to read in data.

An important focus of these sessions is on giving you experience with data analysis: how can you make sense of your data? A big part of this is through visualisation, so we will teach you how to visualise your data by creating different plots.

Throughout the course we will focus on how you can use your data analysis and your plots to communicate your data. What story is your data telling you and what message do you want to get across?

During the sessions we will be working in RStudio which is a software used to help you develop R code. During the course we will be working with one of the most popular packages in R; tidyverse, the umbrella package for dplyr and ggplot2 packages that will allow you to manipulate your data effectively and visualise it to a publication level standard.


Target Audience

This course is designed for participants with no programming experience.


Session overview

Session 1

  • Overview of sessions
  • Data Visualisation Basics & Theory (lecture)
  • Group Exercise on Finding and Critiquing figures

Session 2

  • Introduction to R
  • R Studio
  • R projects and working directories
  • Using R, functions, vectors and missing data
  • Packages and tidyverse

Session 3

  • Data exploration
  • Reading in data
  • Creating plots with ggplot
  • Transforming data with dplyr

Session 4

  • Improving plotting skills
  • Changing transparency, colour
  • Using your data to colour plots
  • Visually splitting your data with faceting

Session 5

  • Customising your plots: labels and annotations
  • Adding lines to your plot
  • Adjusting axes
  • Themes
  • Assembling plots with patchwork
  • Saving publication-ready plots

Session 6

  • Data Visualization Presentation and Feedback


Data

Data are from the paper S. K. Morgan Ernest, Thomas J. Valone, and James H. Brown. 2009. Long-term monitoring and experimental manipulation of a Chihuahuan Desert ecosystem near Portal, Arizona, USA. Ecology 90:1708.

A simplified version of these data, suitable for teaching is available here which is the data we will be using in this course: https://ndownloader.figshare.com/files/2292169

However, we will download them directly from R during the lessons when we need them.


Contributors

This course has originally been created by Alexia Cardona. It has been adapted to suit these practicals by Martin van Rongen, Hugo Tavares, Gita Yadav, Matt Castle and Natalie Wallis.

The materials are very loosely based on the original Data Carpentry lesson in Ecology:

Michonneau F, Teal T, Fournier A, Seok B, Obeng A, Pawlik AN, Conrado AC, Woo K, Lijnzaad P, Hart T, White EP, Marwick B, Bolker B, Jordan KL, Ashander J, Dashnow H, Hertweck K, Cuesta SM, Becker EA, Guillou S, Shiklomanov A, Klinges D, Odom GJ, Jean M, Mislan KAS, Johnson K, Jahn N, Mannheimer S, Pederson S, Pletzer A, Fouilloux A, Switzer C, Bahlai C, Li D, Kerchner D, Rodriguez-Sanchez F, Rajeg GPW, Ye H, Tavares H, Leinweber K, Peck K, Lepore ML, Hancock S, Sandmann T, Hodges T, Tirok K, Jean M, Bailey A, von Hardenberg A, Theobold A, Wright A, Basu A, Johnson C, Voter C, Hulshof C, Bouquin D, Quinn D, Vanichkina D, Wilson E, Strauss E, Bledsoe E, Gan E, Fishman D, Boehm F, Daskalova G, Tavares H, Kaupp J, Dunic J, Keane J, Stachelek J, Herr JR, Millar J, Lotterhos K, Cranston K, Direk K, Tylén K, Chatzidimitriou K, Deer L, Tarkowski L, Chiapello M, Burle M, Ankenbrand M, Czapanskiy M, Moreno M, Culshaw-Maurer M, Koontz M, Weisner M, Johnston M, Carchedi N, Burge OR, Harrison P, Humburg P, Pauloo R, Peek R, Elahi R, Cortijo S, sfn_brt, Umashankar S, Goswami S, Sumedh, Yanco S, Webster T, Reiter T, Pearse W, Li Y (2019). “datacarpentry/R-ecology-lesson: Data Carpentry: Data Analysis and Visualization in R for Ecologists, June 2019.” doi: 10.5281/zenodo.3264888, http://datacarpentry.org/R-ecology-lesson/.

Further resources

These materials are intended to get you started with the concepts of data visualisation, using R. There are many additional resources available on the internet and we’ve compiled a short list of some resources here