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. Even though the directions are pretty straightforward, I had to make a few tweaks in order to recreate the content of the book.
Here are the list of tweaks/corrections to the author’s code :
-
subfigureis used in many places and it is deprecated. Had to replace it withsubcaptionpackage which necessitates specifying the width for every subfigure -
uncomment
captionpackage -
In chapter 6, I found that data from bit.ly addresses were not getting loaded via
repmisandcurl. Hence replaced it with the actual url’s. -
In chapter 7, there is a bug in the code.
- replace
GatheredFert <- gather(SpreadFert, Year, Fert, 3:9)withGatheredFert <- gather(SpreadFert, Year, Fert, 3:6)
- replace
-
In chapter 7, there is a reference to
FinRegulatorDatabut it isn’t loaded in the previous chapters. Hence had to tweak the code to load the dataset -
Include
FertData.RDatain Chapter-7 folder and load the data in Chapter7.Rnw -
In chapter 10, there is a typo for a specific image name. It should be GeoChartScreenshot.png instead of GeoChartScreenShot.png
Some of the above tweaks might be redundant as they could be specific to my system environment. In any case, as a result of all these tweaks I have managed to obtain the contents of the book.
Here is the link to the compiled book :