R solution using self-modifying code
Merge pull request #139 from wch/R-wch

R solution using self-modifying code