This is the code repository for Data Analysis with R - Second Edition, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.
Frequently the tool of choice for academics, R has spread deep into the private sector and can be found in the production pipelines at some of the most advanced and successful enterprises. The power and domain-specificity of R allows the user to express complex analytics easily, quickly, and succinctly.
Starting with the basics of R and statistical reasoning, this book dives into advanced predictive analytics, showing how to apply those techniques to real-world data though with real-world examples.
All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.
The code will look like the following:
# don't worry about memorizing this
temp.density <- density(airquality$Temp)
pdf <- approxfun(temp.density$x, temp.density$y, rule=2)
integrate(pdf, 80, 90)
All code in this book has been written against the latest version of Rโ3.4.3 at time of writing. As a matter of good practice, you should keep your R version up to date but most, if not all, code should work with any reasonably recent version of R. Some of the R packages we will be installing will require more recent versions though. For the other software that this book uses, instructions will be furnished pro re nata. If you want to get a head start, however, install RStudio, JAGS, and a C++ compiler (or Rtools if you use windows).