Updated version of the N-of-1 R code as of 2-5-14