The R Primer

Free Standard Shipping

Purchasing Options

ISBN 9781439862063
Cat# K12876



SAVE 20%

eBook (VitalSource)
ISBN 9781439862087
Cat# KE13047



SAVE 30%

eBook Rentals

Other eBook Options:


  • Presents concise examples and solutions to common problems in R
  • Explains how to read and interpret output from statistical analyses
  • Covers importing data, data handling, and creating graphics
  • Requires a basic understanding of statistics
  • Provides the R code used in the text on a supporting website


Newcomers to R are often intimidated by the command-line interface, the vast number of functions and packages, or the processes of importing data and performing a simple statistical analysis. The R Primer provides a collection of concise examples and solutions to R problems frequently encountered by new users of this statistical software.

Rather than explore the many options available for every command as well as the ever-increasing number of packages, the book focuses on the basics of data preparation and analysis and gives examples that can be used as a starting point. The numerous examples illustrate a specific situation, topic, or problem, including data importing, data management, classical statistical analyses, and high-quality graphics production. Each example is self-contained and includes R code that can be run exactly as shown, enabling results from the book to be replicated. While base R is used throughout, other functions or packages are listed if they cover or extend the functionality.

After working through the examples found in this text, new users of R will be able to better handle data analysis and graphics applications in R. Additional topics and R code are available from the book’s supporting website at

Table of Contents

Importing Data
Reading spreadsheets
Importing data from other statistical software programs
Exporting data

Manipulating Data
Working with data frames
Transforming variables

Statistical Analyses
Descriptive statistics
Linear models
Generalized linear models
Methods for analysis of repeated measurements
Specific methods
Model validation
Contingency tables
Multivariate methods
Resampling statistics and bootstrapping
Robust statistics
Non-parametric methods
Survival analysis

High-level plots
More advanced graphics
Working with graphics

Getting information
R packages
The R workspace



Author Bio(s)

Editorial Reviews

"A ‘primer’ is supposed to be a book that covers very elementary needs. This book does so in a quite special way: It provides 142 problems with solutions, called ‘rules’ … The book efficiently addresses the many impediments against simply ‘go do it’ for people who have already done statistical analyses with software other than R and want to quickly learn how to do the same things in R. … Do I consider this book worth reading/buying ? Yes I do! … [it provides] a collection of useful starting points on how to accomplish practically relevant tasks for applied statistics in R."
—Ulrike Grömping, Journal of Statistical Software, January 2013

… contains a number of interesting self-contained examples, each illustrating a specific situation. One of the salient features is that it covers importing data, handling data, and creating graphics. … Valuable for readers interested in solving statistical problems using R. Summing Up: Recommended.
CHOICE Magazine, April 2012

"This book provides a good introduction to R, using a clear layout and detailed, reproducible examples. An ideal tool for any new R user. … A wide range of topics are covered, making the book suitable for a variety of readers, from undergraduate students to professionals new to R. … an extremely helpful introduction to a very useful statistical package."
—Claire Keeble, Journal of Applied Statistics, 2012

"… a nice starting point for learning R, and suitable for self-study provided the reader has some background in statistics."
—Olle Häggström, International Statistical Review, 2012

Downloads / Updates

Resource OS Platform Updated Description Instructions
Platform type January 20, 2012 Link for Code and Extra Material click on