As we move through this textbook, we will make frequent use of the statistical programming language R, accessing the program through the RStudio Desktop interface, which provides a useful environment for managing files and for writing code. There are many programs you can use in place of R and RStudio: some, such as Python, are free, and others, such as SPSS or Matlab, are commercial packages. We will use R and RStudio for four reasons:
- Both R and RStudio are available at no cost.
- As a programming language, R is designed specifically for the analysis of data; this is one its great strength.
- The base installation of R comes with most of the tools we need, including tools for visualizing data.
- When we need additional tools, packages of functions built by other users are available to us.
To ensure that this textbook is not tied too directly to R—and, therefore, accessible to anyone interested in learning about chemometics—each chapter begins with a general treatment of a chemometric topic that is software-independent, followed by specific examples of how to implement the topic using R.