Link to home

An Introduction to the R Programming Environment

K. A. Garrett, P. D. Esker, and A. H. Sparks

Dept. of Plant Pathology, Kansas State University, Manhattan, KS, USA
Current address of P. D. Esker: Dept. of Plant Pathology, University of Wisconsin, Madison, WI, USA

Sparks, A.H., P.D. Esker, M. Bates, W. Dall' Acqua, Z. Guo, V. Segovia, S.D. Silwal, S. Tolos, and K.A. Garrett, 2008. Ecology and Epidemiology in R: Disease Progress over Time. The Plant Health Instructor. DOI:10.1094/PHI-A-2008-0129-02.

Student Learning Goals

After completion of this module:

  • Students will understand some of the range of potential applications of R in Biology.
  • Students will be able to:
    1. use R in interactive sessions,
    2. use basic programming in R for graphics and dataset manipulation,
    3. generate random numbers and use statistical distributions.


We would appreciate feedback for improving this paper and information about how it has been used for study and teaching. Please send your feedback to Please include the following text in the e-mail subject line, "Feedback on R Modules", to make sure your comments are received.


R is a free software environment that includes a set of base packages for graphics, math, and statistics. You can also make use of specialized packages contributed by R users or write your own new functions. R was developed as a part of the GNU project from the S language,

R performs many of the same statistical analyses as SAS, The trade-off in use of R versus SAS might revolve around the fact that R is free while SAS may have better technical support and testing for features such as linear models in packages like SAS Proc Mixed.

Biologists might be most interested in using R for statistical analysis, ecological modeling (Bolker, in press), and in bioinformatics applications using Bioconductor (Gentleman et al. 2005). Also a set of Plant Health Instructor documents have been prepared to illustrate the use of R in epidemiology and ecology: Disease Progress Over Time, Modeling Dispersal Gradients, Introduction to Spatial Analysis, Disease Forecasting.

For a more comprehensive introduction to R, see the book: An Introduction to R. Notes on R: A Programming Environment for Data Analysis and Graphics, by Venables et al. (2007), especially Appendix A/doc/manuals which gives a sample R session illustrating many features. This book is available on-line through the R website,, or a slightly older bound version is available for purchase with money going to support free software development and documentation. Crawley (2007) provides a substantial reference for R.


Next:  Installing R