Quick knitr notebook I wrote as part of a reply to a question at Cross Validated