## Book description

The Book of R is a comprehensive, beginner-friendly guide to R, the world's most popular programming language for statistical analysis. Even if you have no programming experience and little more than a grounding in the basics of mathematics, you'll find everything you need to begin using R effectively for statistical analysis.

You'll start with the basics, like how to handle data and write simple programs, before moving on to more advanced topics, like producing statistical summaries of your data and performing statistical tests and modeling. You'll even learn how to create impressive data visualizations with R's basic graphics tools and contributed packages, like ggplot2 and ggvis, as well as interactive 3D visualizations using the rgl package.

Dozens of hands-on exercises (with downloadable solutions) take you from theory to practice, as you learn:

• The fundamentals of programming in R, including how to write data frames, create functions, and use variables, statements, and loops
• Statistical concepts like exploratory data analysis, probabilities, hypothesis tests, and regression modeling, and how to execute them in R
• How to access R's thousands of functions, libraries, and data sets
• How to draw valid and useful conclusions from your data
• How to create publication-quality graphics of your results
Combining detailed explanations with real-world examples and exercises, this book will provide you with a solid understanding of both statistics and the depth of R's functionality. Make The Book of R your doorway into the growing world of data analysis.

## Publisher resources

View/Submit Errata

1. Cover
2. Title
4. Brief Contents
5. Contents in Detail
6. Preface
7. Acknowledgments
8. Introduction
1. A Brief History of R
3. For Students
4. For Instructors
9. Part I: The Language
10. Chapter 1: Getting Started
1. 1.1 Obtaining and Installing R from CRAN
2. 1.2 Opening R for the First Time
3. 1.3 Saving Work and Exiting R
4. 1.4 Conventions
11. Chapter 2: Numerics, Arithmetic, Assignment, and Vectors
1. 2.1 R for Basic Math
2. 2.2 Assigning Objects
3. 2.3 Vectors
12. Chapter 3: Matrices and Arrays
1. 3.1 Defining a Matrix
2. 3.2 Subsetting
3. 3.3 Matrix Operations and Algebra
4. 3.4 Multidimensional Arrays
13. Chapter 4: Non-numeric Values
1. 4.1 Logical Values
2. 4.2 Characters
3. 4.3 Factors
14. Chapter 5: Lists and Data Frames
1. 5.1 Lists of Objects
2. 5.2 Data Frames
15. Chapter 6: Special Values, Classes, and Coercion
1. 6.1 Some Special Values
2. 6.2 Understanding Types, Classes, and Coercion
16. Chapter 7: Basic Plotting
1. 7.1 Using plot with Coordinate Vectors
2. 7.2 Graphical Parameters
3. 7.3 Adding Points, Lines, and Text to an Existing Plot
4. 7.4 The ggplot2 Package
17. Chapter 8: Reading and Writing Files
2. 8.2 Reading in External Data Files
3. 8.3 Writing Out Data Files and Plots
18. Part II: Programming
19. Chapter 9: Calling Functions
1. 9.1 Scoping
2. 9.2 Argument Matching
20. Chapter 10: Conditions and Loops
1. 10.1 if Statements
2. 10.2 Coding Loops
3. 10.3 Other Control Flow Mechanisms
21. Chapter 11: Writing Functions
1. 11.1 The function Command
2. 11.2 Arguments
3. 11.3 Specialized Functions
22. Chapter 12: Exceptions, Timings, and Visibility
1. 12.1 Exception Handling
2. 12.2 Progress and Timing
23. Part III: Statistics and Probability
24. Chapter 13: Elementary Statistics
1. 13.1 Describing Raw Data
2. 13.2 Summary Statistics
25. Chapter 14: Basic Data Visualization
1. 14.1 Barplots and Pie Charts
2. 14.2 Histograms
3. 14.3 Box-and-Whisker Plots
4. 14.4 Scatterplots
26. Chapter 15: Probability
1. 15.1 What Is a Probability?
2. 15.2 Random Variables and Probability Distributions
27. Chapter 16: Common Probability Distributions
1. 16.1 Common Probability Mass Functions
2. 16.2 Common Probability Density Functions
28. Part IV: Statistical Testing and Modeling
29. Chapter 17: Sampling Distributions and Confidence
1. 17.1 Sampling Distributions
2. 17.2 Confidence Intervals
30. Chapter 18: Hypothesis Testing
1. 18.1 Components of a Hypothesis Test
2. 18.2 Testing Means
3. 18.3 Testing Proportions
4. 18.4 Testing Categorical Variables
5. 18.5 Errors and Power
31. Chapter 19: Analysis of Variance
1. 19.1 One-Way ANOVA
2. 19.2 Two-Way ANOVA
3. 19.3 Kruskal-Wallis Test
32. Chapter 20: Simple Linear Regression
1. 20.1 An Example of a Linear Relationship
2. 20.2 General Concepts
3. 20.3 Statistical Inference
4. 20.4 Prediction
5. 20.5 Understanding Categorical Predictors
33. Chapter 21: Multiple Linear Regression
1. 21.1 Terminology
2. 21.2 Theory
3. 21.3 Implementing in R and Interpreting
4. 21.4 Transforming Numeric Variables
5. 21.5 Interactive Terms
34. Chapter 22: Linear Model Selection and Diagnostics
1. 22.1 Goodness-of-Fit vs. Complexity
2. 22.2 Model Selection Algorithms
3. 22.3 Residual Diagnostics
4. 22.4 Collinearity
36. Chapter 23: Advanced Plot Customization
1. 23.1 Handling the Graphics Device
2. 23.2 Plotting Regions and Margins
3. 23.3 Point-and-Click Coordinate Interaction
4. 23.4 Customizing Traditional R Plots
5. 23.5 Specialized Text and Label Notation
6. 23.6 A Fully Annotated Scatterplot
37. Chapter 24: Going Further with the Grammar of Graphics
1. 24.1 ggplot or qplot?
3. 24.3 Multiple Plots and Variable-Mapped Facets
4. 24.4 Interactive Tools in ggvis
38. Chapter 25: Defining Colors and Plotting in Higher Dimensions
1. 25.1 Representing and Using Color
2. 25.2 3D Scatterplots
3. 25.3 Preparing a Surface for Plotting
4. 25.4 Contour Plots
5. 25.5 Pixel Images
6. 25.6 Perspective Plots
39. Chapter 26: Interactive 3D Plots
1. 26.1 Point Clouds
2. 26.2 Bivariate Surfaces
3. 26.3 Trivariate Surfaces
4. 26.4 Handling Parametric Equations
40. Appendix A: Installing R and Contributed Packages
2. A.2 Using Packages
3. A.3 Updating R and Installed Packages
4. A.4 Using Other Mirrors and Repositories
5. A.5 Citing and Writing Packages
41. Appendix B: Working with RStudio
1. B.1 Basic Layout and Usage
2. B.2 Auxiliary Tools
42. Reference List
43. Index

## Product information

• Title: The Book of R
• Author(s): Tilman M. Davies
• Release date: July 2016
• Publisher(s): No Starch Press
• ISBN: 9781593276515