The R Book, 3rd Edition

Book description

A start-to-finish guide to one of the most useful programming languages for researchers in a variety of fields

In the newly revised Third Edition of The R Book, a team of distinguished teachers and researchers delivers a user-friendly and comprehensive discussion of foundational and advanced topics in the R software language, which is used widely in science, engineering, medicine, economics, and other fields. The book is designed to be used as both a complete text—readable from cover to cover—and as a reference manual for practitioners seeking authoritative guidance on particular topics.

This latest edition offers instruction on the use of the RStudio GUI, an easy-to-use environment for those new to R. It provides readers with a complete walkthrough of the R language, beginning at a point that assumes no prior knowledge of R and very little previous knowledge of statistics. Readers will also find:

  • A thorough introduction to fundamental concepts in statistics and step-by-step roadmaps to their implementation in R;
  • Comprehensive explorations of worked examples in R;
  • A complementary companion website with downloadable datasets that are used in the book;
  • In-depth examination of essential R packages.

Perfect for undergraduate and postgraduate students of science, engineering, medicine economics, and geography, The R Book will also earn a place in the libraries of social sciences professionals.

Table of contents

  1. Cover
  2. Title Page
  3. Copyright
  4. List of Tables
  5. Preface
  6. Acknowledgments
  7. About the Companion Website
  8. 1 Getting Started
    1. 1.1 Navigating the book
    2. 1.2 vs. RStudio
    3. 1.3 Installing and RStudio
    4. 1.4 Using RStudio
    5. 1.5 The Comprehensive Archive Network
    6. 1.6 Packages in
    7. 1.7 Getting help in
    8. 1.8 Good housekeeping
    9. 1.9 Linking to other computer languages
    10. References
  9. 2 Technical Background
    1. 2.1 Mathematical functions
    2. 2.2 Matrices
    3. 2.3 Calculus
    4. 2.4 Probability
    5. 2.5 Statistics
    6. Reference
  10. 3 Essentials of the Language
    1. 3.1 Calculations
    2. 3.2 Naming objects
    3. 3.3 Factors
    4. 3.4 Logical operations
    5. 3.5 Generating sequences
    6. 3.6 Class membership
    7. 3.7 Missing values, infinity, and things that are not numbers
    8. 3.8 Vectors and subscripts
    9. 3.9 Working with logical subscripts
    10. 3.10 Vector functions
    11. 3.11 Matrices and arrays
    12. 3.12 Random numbers, sampling, and shuffling
    13. 3.13 Loops and repeats
    14. 3.14 Lists
    15. 3.15 Text, character strings, and pattern matching
    16. 3.16 Dates and times in
    17. 3.17 Environments
    18. 3.18 Writing functions
    19. 3.19 Structure of objects
    20. 3.20 Writing from to a file
    21. 3.21 Tips for writing code
    22. References
  11. 4 Data Input and Dataframes
    1. 4.1 Working directory
    2. 4.2 Data input from files
    3. 4.3 Data input directly from the web
    4. 4.4 Built‐in data files
    5. 4.5 Dataframes
    6. 4.6 Using the match () function in dataframes
    7. 4.7 Adding margins to a dataframe
  12. 5 Graphics
    1. 5.1 Plotting principles
    2. 5.2 Plots for single variables
    3. 5.3 Plots for showing two numeric variables
    4. 5.4 Plots for numeric variables by group
    5. 5.5 Plots showing two categorical variables
    6. 5.6 Plots for three (or more) variables
    7. 5.7 Trellis graphics
    8. 5.8 Plotting functions
    9. References
  13. 6 Graphics in More Detail
    1. 6.1 More on colour
    2. 6.2 Changing the look of graphics
    3. 6.3 Adding items to plots
    4. 6.4 The grammar of graphics and ggplot2
    5. 6.5 Graphics cheat sheet
    6. References
  14. 7 Tables
    1. 7.1 Tabulating categorical or discrete data
    2. 7.2 Tabulating summaries of numeric data
    3. 7.3 Converting between tables and dataframes
    4. Reference
  15. 8 Probability Distributions in
    1. 8.1 Probability distributions: the basics
    2. 8.2 Probability distributions in
    3. 8.3 Continuous probability distributions
    4. 8.4 Discrete probability distributions
    5. 8.5 The central limit theorem
    6. References
  16. 9 Testing
    1. 9.1 Principles
    2. 9.2 Continuous data
    3. 9.3 Discrete and categorical data
    4. 9.4 Bootstrapping
    5. 9.5 Multiple tests
    6. 9.6 Power and sample size calculations
    7. 9.7 A table of tests
    8. References
  17. 10 Regression
    1. 10.1 The simple linear regression model
    2. 10.2 The multiple linear regression model
    3. 10.3 Understanding the output
    4. 10.4 Fitting models
    5. 10.5 Checking model assumptions
    6. 10.6 Using the model
    7. 10.7 Further types of regression modelling
    8. References
  18. 11 Generalised Linear Models
    1. 11.1 How GLMs work
    2. 11.2 Count data and GLMs
    3. 11.3 Count table data and GLMs
    4. 11.4 Proportion data and GLMs
    5. 11.5 Binary Response Variables and GLMs
    6. 11.6 Bootstrapping a GLM
    7. References
  19. 12 Generalised Additive Models
    1. 12.1 Smoothing example
    2. 12.2 Straightforward examples of GAMs
    3. 12.3 Background to using GAMs
    4. 12.4 More complex GAM examples
    5. References
  20. 13 Mixed‐Effect Models
    1. 13.1 Regression with categorical covariates
    2. 13.2 An alternative method: random effects
    3. 13.3 Common data structures where random effects are useful
    4. 13.4 packages to deal with mixed effects models
    5. 13.5 Examples of implementing random effect models
    6. 13.6 Generalised linear mixed models
    7. 13.7 Alternatives to mixed models
    8. References
  21. 14 Non‐linear Regression
    1. 14.1 Example: modelling deer jaw bone length
    2. 14.2 Example: grouped data
    3. 14.3 Self‐starting functions
    4. 14.4 Further considerations
    5. References
  22. 15 Survival Analysis
    1. 15.1 Handling survival data
    2. 15.2 The survival and hazard functions
    3. 15.3 Modelling survival data
    4. References
  23. 16 Designed Experiments
    1. 16.1 Factorial experiments
    2. 16.2 Pseudo‐replication
    3. 16.3 Contrasts
    4. References
  24. 17 Meta‐Analysis
    1. 17.1 Elements of a meta‐analysis
    2. 17.2 Meta‐analysis in
    3. 17.3 Examples
    4. 17.4 Meta‐analysis of categorical data
    5. References
  25. 18 Time Series
    1. 18.1 Moving average
    2. 18.2 Blowflies
    3. 18.3 Seasonal data
    4. 18.4 Multiple time series
    5. 18.5 Some theoretical background
    6. 18.6 ARIMA example
    7. 18.7 Simulation of time series
    8. Reference
  26. 19 Multivariate Statistics
    1. 19.1 Visualising data
    2. 19.2 Multivariate analysis of variance
    3. 19.3 Principal component analysis
    4. 19.4 Factor analysis
    5. 19.5 Cluster analysis
    6. 19.6 Hierarchical cluster analysis
    7. 19.7 Discriminant analysis
    8. 19.8 Neural networks
    9. References
  27. 20 Classification and Regression Trees
    1. 20.1 How CARTs work
    2. 20.2 Regression trees
    3. 20.3 Classification trees
    4. 20.4 Looking for patterns
    5. References
  28. 21 Spatial Statistics
    1. 21.1 Spatial point processes
    2. 21.2 Geospatial statistics
    3. References
  29. 22 Bayesian Statistics
    1. 22.1 Components of a Bayesian Analysis
    2. 22.2 Bayesian analysis in
    3. 22.3 Examples
    4. 22.4 MCMC for a model with binomial errors
    5. References
  30. 23 Simulation Models
    1. 23.1 Temporal dynamics
    2. 23.2 Spatial simulation models
    3. 23.3 Temporal and spatial dynamics: random walk
    4. References
  31. Index
  32. End User License Agreement

Product information

  • Title: The R Book, 3rd Edition
  • Author(s): Elinor Jones, Simon Harden, Michael J. Crawley
  • Release date: September 2022
  • Publisher(s): Wiley
  • ISBN: 9781119634324