Make sure you follow technocrat’s link to the 2nd edition, which is based on the forecast package. Read the Appendix: Using R for instructions to install forecast and other required packages.
There is also a draft version of the 3rd edition of their book. It uses the tidyverts set of packages, which is still maturing.