Ecol 596W – Programming for Data Analysis in R

Spring semester 2016

R Course Home


This course will teach the fundamentals of programming for data analysis in R. The course emphasis is practical, providing skills for more effective research and encouraging immediate application to students’ own work.

The course is based on a unique set of tutorials that provide a complete foundation of techniques in R, which are broadly applicable across research disciplines. We start from the very beginning, and build toward powerful techniques such as fast iteration of custom functions. We will apply a variety of packaged and custom statistical tests. The latest iteration of course tutorials and outline are available at the following link, but note that these will be updated throughout the course:

What is R?

R should be thought of as a language for analyzing data. Creative and thorough data analysis involves not only statistical tests, but complex manipulation of datasets, e.g., merging multiple data sources, assessing nested structures, interactions, alternative conditions, data gaps, etc. Very few datasets are simple enough to fully explore and understand by manual manipulation in spreadsheet programs like Excel. Programming solves these problems. An R “script” records all analysis steps, both in English (via ‘comments’) and in R language (via code), while also performing the analysis.

Teaching method

R is a foreign language. As other introductory programming and foreign language courses are taught, this course uses ‘repeat after me’ class exercises. We will teach the principles—the meanings of the terms and the syntax that links terms into functional sentences—and students will follow along in typing in the code corresponding to each example in a neatly formatted R script. This will build muscle memory as students practice ‘speaking the language’, allowing observation of the results on their own screens. The course provides practical exercises, done in class in groups, and/or independently as homework. Students are expected to work toward a final project that creatively applies lessons of the course to unique questions in real datasets (including from students’ own research).

Leave a Reply