Compiling RR book
The author of the book titled Reproducible Research with R and RStudio - Second edition , Christopher Gandrud, has made the relevant code available on github. This code can be run to obtain a book that is identical to the one that is available in the stores(that is priced at $45). I have spent more than an hour trying to run the code as there are many prerequisite packages that need to be installed.