R is rapidly becoming the standard for developing statistical software, and R in a Nutshell provides a quick and practical way to learn this increasingly popular open source language and environment. You'll not only learn how to program in R, but also how to find the right usercontributed R packages for statistical modeling, visualization, and bioinformatics.

R Basics

Chapter 1 Getting and Installing R
 R Versions
 Getting and Installing Interactive R Binaries

Chapter 2 The R User Interface
 The R Graphical User Interface
 The R Console
 Batch Mode
 Using R Inside Microsoft Excel
 Other Ways to Run R

Chapter 3 A Short R Tutorial
 Basic Operations in R
 Functions
 Variables
 Introduction to Data Structures
 Objects and Classes
 Models and Formulas
 Charts and Graphics
 Getting Help

Chapter 4 R Packages
 An Overview of Packages
 Listing Packages in Local Libraries
 Loading Packages
 Exploring Package Repositories
 Custom Packages


The R Language

Chapter 5 An Overview of the R Language
 Expressions
 Objects
 Symbols
 Functions
 Objects Are Copied in Assignment Statements
 Everything in R Is an Object
 Special Values
 Coercion
 The R Interpreter
 Seeing How R Works

Chapter 6 R Syntax
 Constants
 Operators
 Expressions
 Control Structures
 Accessing Data Structures
 R Code Style Standards

Chapter 7 R Objects
 Primitive Object Types
 Vectors
 Lists
 Other Objects
 Attributes

Chapter 8 Symbols and Environments
 Symbols
 Working with Environments
 The Global Environment
 Environments and Functions
 Exceptions

Chapter 9 Functions
 The Function Keyword
 Arguments
 Return Values
 Functions As Arguments
 Argument Order and Named Arguments
 Side Effects

Chapter 10 ObjectOriented Programming
 Overview of ObjectOriented Programming in R
 ObjectOriented Programming in R: S4 Classes
 OldSchool OOP in R: S3

Chapter 11 HighPerformance R
 Use Builtin Math Functions
 Use Environments for Lookup Tables
 Use a Database to Query Large Data Sets
 Preallocate Memory
 Monitor How Much Memory You Are Using
 Functions for Big Data Sets
 Parallel Computation with R
 HighPerformance R Binaries


Working with Data

Chapter 12 Saving, Loading, and Editing Data
 Entering Data Within R
 Saving and Loading R Objects
 Importing Data from External Files
 Exporting Data
 Importing Data from Databases

Chapter 13 Preparing Data
 Combining Data Sets
 Transformations
 Binning Data
 Subsets
 Summarizing Functions
 Data Cleaning
 Finding and Removing Duplicates
 Sorting

Chapter 14 Graphics
 An Overview of R Graphics
 Graphics Devices
 Customizing Charts

Chapter 15 Lattice Graphics
 History
 An Overview of the Lattice Package
 HighLevel Lattice Plotting Functions
 Customizing Lattice Graphics
 LowLevel Functions


Statistics with R

Chapter 16 Analyzing Data
 Summary Statistics
 Correlation and Covariance
 Principal Components Analysis
 Factor Analysis
 Bootstrap Resampling

Chapter 17 Probability Distributions
 Normal Distribution
 Common DistributionType Arguments
 Distribution Function Families

Chapter 18 Statistical Tests
 Continuous Data
 Discrete Data

Chapter 19 Power Tests
 Experimental Design Example
 tTest Design
 Proportion Test Design
 ANOVA Test Design

Chapter 20 Regression Models
 Example: A Simple Linear Model
 Details About the lm Function
 Subset Selection and Shrinkage Methods
 Nonlinear Models
 Survival Models
 Smoothing
 Machine Learning Algorithms for Regression

Chapter 21 Classification Models
 Linear Classification Models
 Machine Learning Algorithms for Classification

Chapter 22 Machine Learning
 Market Basket Analysis
 Clustering

Chapter 23 Time Series Analysis
 Autocorrelation Functions
 Time Series Models

Chapter 24 Bioconductor
 An Example
 Key Bioconductor Packages
 Data Structures
 Where to Go Next


Appendix R Reference

base

boot

class

cluster

codetools

foreign

grDevices

graphics

grid

KernSmooth

lattice

MASS

methods

mgcv

nlme

nnet

rpart

spatial

splines

stats

stats4

survival

tcltk

tools

utils


Bibliography

Colophon
 Title:
 R in a Nutshell
 By:
 Joseph Adler
 Publisher:
 O'Reilly Media
 Formats:

 Ebook
 Safari Books Online
 Print Release:
 December 2009
 Ebook Release:
 December 2009
 Pages:
 640
 Print ISBN:
 9780596801700
  ISBN 10:
 059680170X
 Ebook ISBN:
 9781449378684
  ISBN 10:
 1449378684
The animal on the cover of R in a Nutshell is a harpy eagle (Harpia harpyja). Black feathers line the top half of the bird, while white feathers mostly make up the balance, although the underside of its wings may be striped blackandwhite. Unlike other species of birds, male and female harpy eagles appear virtually identical.
These eaglesthe most powerful, carnivorous raptors in the Americastypically inhabit tropical rain forests. They prey upon animals that live in trees: sloths, monkeys, opossums, and even other birds, such as macaws.
The eagle is named after the harpies of ancient Greek mythology, female wind spirits who were said to be human from the chest to their ankles and eagle from the neck up. Mythological harpies tormented people as they carried them to the underworld with their clawed feet; perhaps similarly, harpy eagles' talons violently pierce and subdue their prey before the eagles carry them back to their nests.
Harpy eagles also inspire modernday life: the eagle is the national bird of Panama and is pictured on the country's coat of arms. The bird also inspired the design of Fawkes the Phoenix in the Harry Potter film series.
The cover image is from Cassell's Natural History. The cover font is Adobe ITC Garamond. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSansMonoCondensed.