What you need for this book
All the code examples provided in this book should be run in the R console, which needs to be installed on your computer. You can download the software for free and find the installation instructions for all major operating systems at http://r-project.org.
Although we will not cover advanced topics, such as how to use R in Integrated Development Environments (IDE), there are awesome plugins and extensions for Emacs, Eclipse, vi, and Notepad++, besides other editors. Also, we highly recommend that you try RStudio, which is a free and open source IDE dedicated to R, at https://www.rstudio.com/products/RStudio.
Besides a working R installation, we will also use some user-contributed R packages. These can easily be installed from the Comprehensive R Archive Network (CRAN) in most cases. The sources of the required packages and the versions used to produce the output in this book are listed in Appendix, References.
To install a package from CRAN, you will need an Internet connection. To download the binary files or sources, use the install.packages
command in the R console, like this:
> install.packages('pander')
Some packages mentioned in this book are not (yet) available on CRAN, but may be installed from Bitbucket or GitHub. These packages can be installed via the install_bitbucket
and the install_github
functions from the devtools
package. Windows users should first install rtools
from https://cran.r-project.org/bin/windows/Rtools.
After installation, the package should be loaded to the current R session before you can start using it. All the required packages are listed in the appendix, but the code examples also include the related R command for each package at the first occurrence in each chapter:
> library(pander)
We highly recommend downloading the code example files of this book (refer to the Downloading the example code section) so that you can easily copy and paste the commands in the R console without the R prompt shown in the printed version of the examples and output in the book.
If you have no experience with R, you should start with some free introductory articles and manuals from the R home page, and a short list of suggested materials is also available in the appendix of this book.