
xxiii
Introduction
is is a beginning to intermediate book on the statistical language and computing environment called R. As
you will learn, R is freely available and open source. ousands of contributed packages are available from
members of the R community. In this book, you learn how to get R, install it, use it as a command-line interpreted
language, program in it, write custom functions, use it for the most common descriptive and inferential statistics,
and write an R package. You also learn some “newer” statistical techniques including bootstrapping and
simulation, as well as how to use R graphical user interfaces (GUIs) including RStudio and RCommander.
Who is Book Is For
is book is for working professionals who need to learn R to perform statistical analyses. Additionally, statistics
students and professors will nd this book helpful as a textbook, a supplement for a statistical computing class,
or a reference for various statistical analyses. Both statisticians who want to learn R and R programmers who
need a refresher on statistics will benet from the clear examples, the hands-on nature of the book, and the
conversational style in which the book is written.
How is Book Is Structured
is book is structured in 20 chapters, each of which covers the use of R for a particular purpose. In the rst
three chapters, you learn how to get and install R and R packages, how to program in R, and how to write
custom functions. e standard descriptive statistics and graphics are covered in Chapters 4 to 7.
Chapters 8 to 14 cover the customary hypothesis tests concerning means, correlation and regression, and
multiple regression. Chapter 14 introduces logistic regression. Chapter 15 covers chi-square tests. Following
the standard nonparametric procedures in Chapter 16, Chapters 17 and 18 introduce simulation and the “new”
statistics including bootstrapping and permutation tests. e nal two chapters cover making an R package and
using the RCommander package as a point-and-click statistics interface.
Conventions
In this book, we use TheSansMonoConNormalfont to show R code both inline and as code segments. e R code is
typically shown as you would see it in the R Console or the R Editor. All hyperlinks shown in this book were active
at the time of printing. Hyperlinks are shown in the following fashion:
http://www.apress.com
When you use the mouse to select from the menus in R or an R GUI, the instructions will appear as shown
below. For example, you may be directed to install a package by using the Packages menu in the RGui. e
instructions will state simply to select Packages ° Install packages... (the ellipsis points mean that an
additional dialog box or window will open when you click Install packages). In the current example, you will
see a list of mirror sites from which you can download and install R packages.