Note

Note

This particular set of lessons has revisions by Karl Broman for a Data Carpentry workshop at UW-Madison on 23-24 August 2016. The official Data Carpentry R-Ecology lessons are at http://www.datacarpentry.org/R-ecology-lesson/.

Data Carpentry R for data analysis for Ecology

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 for data analysis.

This is an introduction to R designed for participants with no programming experience. These lessons can be taught in 3/4 of a day. They start with some basic information about R syntax, the RStudio interface, and move through how to import CSV files, the structure of data.frame, how to deal with factors, how to add/remove rows and columns, and finish with how to calculate summary statistics for each level and a very brief introduction to plotting.

Content Contributors: Sarah Supp, John Blischak, Gavin Simpson, Tracy Teal, Greg Wilson, Diego Barneche, Stephen Turner, Francois Michonneau

Lesson Maintainers: Francois Michonneau, Auriel Fournier

Lesson status: Teaching

Lessons:

  1. Introduction to R
  2. Aggregating and analyzing data with dplyr
  3. Data visualization with ggplot2
  4. Reproducible reports with R Markdown
  5. Capstone project

Data

The data for this lesson is available as a single CSV file, http://kbroman.org/datacarp/portal_data_joined.csv.

We’ll download the file during the course of the lesson.

Requirements

Data Carpentry’s teaching is hands-on, so participants are encouraged to use their own computers to insure 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 install everything before working through this lesson.

R

R is a programming language that is especially powerful for data exploration, visualization, and statistical analysis. To interact with R, we use RStudio. Make sure you have a recent version of R (3.2.2 or higher).

Windows

Install R by downloading and running this .exe file from CRAN. Also, please install the RStudio IDE.

Mac OS X

Install R by downloading and running this .pkg file from CRAN. If you have Snow Leopard, you might run into issues when trying to download the datasets directly from R using the `download.file()` function. If it's the case, you will need to download the data files manually. Don't hesitate to ask the instructor for help if you run into issues. Also, please install the RStudio IDE.

Linux

You can download the binary files for your distribution from CRAN. Or you can use your package manager (e.g. for Debian/Ubuntu run sudo apt-get install r-base and for Fedora run sudo yum install R). This workshop requires a version of R no older than version 3.2.2; the default software repositories for some Linux distributions maybe out of date. It is recommended that you use a more recent version of R by adding the relevant entries to your package manager. See the instructions for your distribution on the CRAN website. Also, please install the RStudio IDE.

Twitter: @datacarpentry