Bioinformatics Training Facility
University of Cambridge
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. We will start from scratch by introducing how to start programming in R and progress our way and learn how to read and write to files, manipulate data and visualise it by creating different plots - all the fundamental tasks you need to get you started analysing your data. 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.
This course is designed for participants with no programming experience.
Data is 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 this data, suitable for teaching is available here which is the data we will be using in this course: https://doi.org/10.6084/m9.figshare.1314459
However, we will download them directly from R during the lessons when we need them.
All the software required to run this course is installed on your machine, so you do need to do the following sections. In case you are working on this on another machine please follow the instructions below:
R and RStudio are separate downloads and installations. R is the underlying statistical computing environment, but using R alone is no fun. RStudio is a graphical integrated development environment (IDE) that makes using R much easier and more interactive. You need to install R before you install RStudio. After installing both programs, you will need to install the
tidyverse package from within RStudio. Follow the instructions below for your operating system, and then follow the instructions to install the
sessionInfo(), which will also display which version of R you are running. Go on the CRAN website and check whether a more recent version is available. If so, please download and install it. You can check here for more information on how to remove old versions from your system if you wish to do so.
.exefile that was just downloaded
sessionInfo(), which will also display which version of R you are running. Go on the CRAN website and check whether a more recent version is available. If so, please download and install it.
.pkgfile for the latest R version
sudo apt-get install r-base, and for Fedora
sudo yum install R), but we don’t recommend this approach as the versions provided by this are usually out of date. In any case, make sure you have at least R 3.3.1.
sudo dpkg -i rstudio-x.yy.zzz-amd64.debat the terminal).
After installing R and RStudio, you need to install the
After starting RStudio, at the console type:
You can also do this by going to Tools -> Install Packages and typing the names of the packages separated by a comma.
This course has been created by Alexia Cardona by adapting and adding new content to the 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/.