This is a modification of the Data Carpentry R for Ecologists lesson, for use in the Microbial Bioinformatics workshop series at UCSF. It has been modified to use microbiome 16S rRNA amplicon sequencing data as an example dataset.
Data Carpentry’s aim is to teach researchers basic concepts, skills, and tools for working with data so that they can get more done in less time, and with less pain. The lessons below were designed for those interested in working with ecology data in R.
This is an introduction to R designed for participants with no programming experience. These lessons can be taught in a day (~ 6 hours). They start with some basic information about R syntax, the RStudio interface, and move through how to import CSV files, the structure of data frames, how to deal with factors, how to add/remove rows and columns, how to calculate summary statistics from a data frame, and an introduction to plotting.
Data Carpentry’s teaching is hands-on, so participants are encouraged to use their own computers to ensure the proper setup of tools for an efficient workflow. These lessons assume no prior knowledge of the skills or tools, but working through this lesson requires working copies of the software described below. To most effectively use these materials, please make sure to download the data and install everything before working through this lesson.
This workshop uses data files from Jordan Bisanz's workshop on analyzing microbiome data with qiime2. They can be downloaded from the GitHub repository for that workshop.
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 tidyverse
and qiime2R
.
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..exe
file that was just downloadedsessionInfo()
, 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..pkg
file for the latest R versionsudo 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.deb
at the terminal).After installing R and RStudio, you need to install the tidyverse
and qiime2R
packages.
After starting RStudio, at the console type: install.packages(c("tidyverse", "remotes"))
Then you'll need to install qiime2R using the remotes package: remotes::install_github("jbisanz/qiime2R")
The list of contributors to this lesson is available here.
Page built on: 📆 2019-09-10 ‒ 🕢 15:11:05
Data Carpentry, 2014-2019.
Questions? Feedback?
Please file
an issue on GitHub.
On Twitter: @datacarpentry
If this lesson is useful to you, consider