Simple function to create a seed token, that can later be assigned to .Random.seed this will allow reproducibility of results, even when pieces of the code are moved around The downside is that the code will slowly get cluttered with seed tokens, which at some point will need to be replaced & the test code updated. But this will forstall that day, and at least ensure that code that passed the test is being used to replace the test code. And that reassures me greatly. Thanks to Ben Bolker's answer on Stack Overflow: http://stackoverflow.com/questions/13997444/print-the-current-random-seed-so-that-i-can-enter-it-with-set-seed-later The seed can be restored by doing load("SeedToken
1 | save.seed(run.id, seed.id)
|
run.id |
Identifies which test run is being run |
seed.id |
Identifies the location where the seed needs saving |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.