Introduction to R

A workshop for UChicago BSD researchers

Wednesday, Sep 14, 2016

Registration

Registration is required and is limited to those affiliated with the Biological Sciences Division. Please register at 2016-09-14-introR.eventbrite.com.


General Information

This interactive workshop will cover the basics of R. R is a programming language that is especially powerful for data exploration, visualization, and statistical analysis.

Coffee and lunch will be provided.

When: 8:00 am - 4:30 pm, Wednesday, Sep 14, 2016

Who: The course is limited to graduate students and other researchers in the Biological Sciences Division at the University of Chicago.

Prerequisites: There are no prerequisites. Attendees are expected to have no (or little) previous programming experience. If you are already familiar with the basics of R, you should consider attending our Software Carpentry Workshop, which will focus on intermediate R concepts as well as other tools for scientific computing.

Where: Stuart 101, 5835 South Greenwood Avenue Chicago, IL 60637. Get directions with OpenStreetMap or Google Maps.

Requirements: Participants must bring a laptop with a Mac, Linux, or Windows operating sytem (not a tablet, Chromebook, etc.) that they have administrative privileges on. They should have a few specific software packages installed (listed below).

Instructors: John Blischak, Emily Davenport

Helpers: Lauren Blake, Arjun Biddanda, Joe Marcus

Faculty advisors: Allan Drummond, Matthew Stephens, Mark Abney

Administrators: Lisa Anderson, Candice Lewis

Funding: This workshop was made possible through the generous sponsorhip of the Office of Graduate and Postdoctoral Affairs, the Department of Human Genetics, and the Department of Biochemistry and Molecular Biology.

Contact: Please mail jdblischak@uchicago.edu for more information.


Schedule

Sep 14

08:00 am - 08:30 am - Introduction to RStudio
08:30 am - 10:00 am - Analyze data with R
10:00 am - 10:30 am - Coffee break
10:30 am - 12:00 pm - Organize your code with R functions
12:00 pm - 01:00 pm - Lunch
01:00 pm - 02:30 pm - Automate tasks with loops
02:30 pm - 03:00 pm - Coffee break
03:00 pm - 04:30 pm - Make choices with if/else statements

Syllabus

Introduction to RStudio

We will introduce the basic functionalities of RStudio, a useful integrated development environment (IDE) for writing R code.

Analyze data with R

We will demonstrate how to import a data set, calculate descriptive statistics, and create some basic plots.

Organize your code with R functions

We can extend R by converting common routines into functions. This allows us to execute the same commands on many different input arguments. Best of all, writing functions makes it easier to read and maintain your code. In this lesson, we convert the analysis we performed in the previous lesson into a function that can then be applied to any similar input data set.

Automate tasks with loops

One of the main advantages of writing code over using spreadsheet software is that it is easier to repeat the analysis on new data sets. In this lesson, we use loops to automatically apply the function we wrote in the previous lesson to process multiple data sets.

Make choices with if/else statements

Automated data analysis pipelines can be made even more powerful by allowing the code to make decisions based on the input parameters and data. In this lesson, we modify our code from the previous lessons so that it will save the analysis plots to a specific file only if we provide a filename as input. This allows us to choose whether to immediately view the results in the RStudio window or save the results to a file.


Setup

Please install R and RStudio following the directions below for the operating system on your laptop.

Windows

Video Tutorial

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

Mac OS X

Video Tutorial

Install R by downloading and running this .pkg file from CRAN. 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). Also, please install the RStudio IDE.


Aknowledgments

The materials used for this workshop are based on open source content produced by Software Carpentry. Specifically, this workshop webpage was adapted from their workshop template, and the R lesson material is their lesson Programming with R. This page was generated by GitHub Pages using the Architect theme by Jason Long.