The book has an associated R package that you should install to be able to follow the code that is given in the chapters. The package includes several functions that can be useful irrespectively of the book. The package also includes data sets used in the book.
The installation of the book R package can be done as any other R
package. Specifically, you should run R and then (provided you have
Internet connection) you can type the following at R prompt:
install.packages("DMwR")
That function call will install the packages and all required dependencies.