Chapter 1 Prerequisites

1.1 Install R and RStudio

All examples in this book are run in an R environment. You also need a recent version of RStudio, which is a software application that facilitates how you interact with R. It is developed by data enthusiasts who consider statistics to be more than just simulations, formulas and proofs. RStudio emphasizes the following:

  1. Version control: Why I should use version control especially for the solo data analyst.

  2. Reproducible research: seamless integration with RMarkdown for creating dynamic documents and presentations

  3. Creating R Packages: seamless integration with the devtools package for creating software that implements your statistical method or analysis.

1.2 R Packages

The following packages will be called upon at some point, so please install them before getting started with the tutorials. Enter the following command in R:

install.packages(c("knitr", "data.table", "rmarkdown", "dplyr", "purrr", "tidyr", 
    "ggplot2", "pwr", "glmnet", "boot", "DAAG"))

1.3 Background Reading

The greatest thing about R is that there are so many people out there willing to help you. R users are constantly writing tutorials and creating packages to make your analysis tasks easier. Here is a very targeted list that I suggest reading prior to starting the tutorials

  1. Writing Functions
  2. for loops
  3. apply vs. for