Used Stangle to extract R code from .Rnw file into a .R file