`jomoImpute` removes `.Random.seed`
stefvanbuuren opened this issue · 4 comments
The .Random.seed
is removed by jomoImpute
:
type <- c(-2,0,0,0,0,1,3,1,0,0)
names(type) <- colnames(studentratings)
imp <- jomoImpute(studentratings, type=type, n.burn=100, n.iter=10, m=5)
.Random.seed
Error: object '.Random.seed' not found
It happens also after first running set.seed(1)
. Cannot see why we would want this to happen.
Thanks for catching this; that is not the intended behavior. I uploaded a fix that should take care of the issue. Can you check with the current version if the problem persists?
Thanks. The error has gone, but now I get exactly the same solution if I do two successive calls to jomoImpute
, which is probably not intended.
I think you're right. The best solution I can see is to (a) save and restore the seed if (and only if) a user-defined seed is provided, and (b) leave it alone otherwise. Case (a) includes the possibility that the seed is deleted after running MI if it was not set before in .GlobalEnv
. The newest commit includes the required changes. Can you check back if this meets your expectations?
Yes. This one is perfect. Thanks a lot.