This is a primitive example of how to package up code for a paper. It is so primitive that it is just a bash script, seriously. that's primitive.
This is essentially what I packaged up as verification code for the Why Publishing Everything Is More Effective than Selective Publishing of Statistically Significant Results labs page which is based off of this production example.
Additionally, the R code accompanying the paper would have taken quite a long time to run. We changed the number of reps so that users can download the code and run it in a few minutes. Look at commit 3658f6d1c3592b2e1dd50987d55b0209a4ea9d94 to see the demo diff.