R Scripts

Available below are sample scripts* I used for teaching the Quantitative Biology Laboratory (BIOL 315/415) course at Case Western Reserve University in Spring 2013.

  • Lab 1 provides an introduction to using R, including reading in data files, viewing their contents, and manipulating them to produce a line graph.
  • Lab 2 provides additional practice manipulating data in R and demonstrating the importance of using metadata to understand a data set and appropriately analyze it.
  • Lab 3 provides commands for producing line graphs, scatterplots, boxplots, and bar graphs.
  • Lab 4 gives an introduction to basic parametric statistics, including ANOVA, two-way ANOVA, simple linear regression, and multiple linear regression.
  • Lab 5 expands students’ experience with statistics, including using mixed effects models for nested sampling designs with repeated measures, as well as introducing the process of backwards model selection.
  • Lab 6 provides a primer on ordination in R, including Principal Components Analysis and Nonmetric Multidimensional Scaling.
Freeman, M. 2006.  J Epidemiol Community Health 60:6.

*Note that these scripts were created for a PC and were of appropriate length for a 3-hr computer lab that included a brief introductory lecture and quiz. Scripts generally follow Google’s R Style Guide.