Currently slimr does not handle random seeds very well while interacting with SLiM. SLiM has its own random seed that can be modified from slimr by setting the seed inside the code sent to SLiM. However, it is currently not possible to modify the seed without this (such as you might want to do when running an existing script that doesn't explicitly set the seed, which you normally would do by passing a random seed to SLiM through the command line interface). I think that we should pass the current R session seed to SLiM via the command-line (in processx). That way if a user sets the seed in R, it will also be passed to any runs in SLiM so that they should also be reproducible for a given seed value set in R. This would also help with certain testthat tests which currently occasionally fail because of some randomness in the SLiM runs. This should be fairly easy to do.
Currently
slimr
does not handle random seeds very well while interacting with SLiM. SLiM has its own random seed that can be modified fromslimr
by setting the seed inside the code sent to SLiM. However, it is currently not possible to modify the seed without this (such as you might want to do when running an existing script that doesn't explicitly set the seed, which you normally would do by passing a random seed to SLiM through the command line interface). I think that we should pass the current R session seed to SLiM via the command-line (inprocessx
). That way if a user sets the seed in R, it will also be passed to any runs in SLiM so that they should also be reproducible for a given seed value set in R. This would also help with certaintestthat
tests which currently occasionally fail because of some randomness in the SLiM runs. This should be fairly easy to do.