Appendix B — R Code for Figures and Analyses

This online appendix lists the R source files used to produce some of the figures and analyses in each chapter, with links to the source code on GitHub.

This is included here because it may be useful to readers to see the complete context in which many examples were developed, beyond the code displayed in the text. And also because you may want to use or adapt the code for your own work or to develop related examples using the same ideas with different datasets.

It is incomplete because it was consctructed by scanning the chapter source files for special comments, of the form <!-- fig.code: R/Davis-reg.R --> that were manually embedded in the chapter .qmd files as I wrote this, but not always. Making this less incomplete proved to be a challenge because it involved scanning the text to find the corresponding R code files that had been included that had been included in chunks.

Files marked ⚠ do not yet have a descriptive title in their header.

Chapter 3: Getting Started

Chapter 4: Plots of Multivariate Data

Chapter 5: Dimension Reduction

Chapter 6: Overview of Linear models

Chapter 7: Plots for Univariate Response Models

Chapter 8: Topics in Linear Models

Chapter 9: Collinearity & Ridge Regression

Chapter 10: Hotelling’s \(T^2\)

Chapter 12: Visualizing Multivariate Models

Chapter 14: Multivariate Influence and Robust Estimation

Appendix: Discriminant analysis

Rcode

Utilities

These R files are source()d by one or more of the scripts above. They define custom functions and helpers used across multiple chapters.