<div dir="ltr">Dear Rcpp experts,<div><br></div><div style> I would like to be able to store the R random seed from a Rcpp</div><div style>function and then reset it. In other words I would like to replicate</div><div style>
the following code in Rcpp:</div><div style><br></div><div style><div>savedSeed <- .Random.seed</div><div>x <- Rfunction(parameters1);</div><div>      </div><div>.Random.seed <- savedSeed</div><div>x1 <- Rfunction(parameters2); </div>
<div><br></div><div style>where Rfunction simulates some random numbers and uses them</div><div style>but with different parameter values.</div><div style>Is it possible to do something similar in Rcpp?</div><div style>Probably using GetRNGstate() and PutRNGstate()?</div>
<div style><br></div><div style>Thanks,</div><div style><br></div><div style>Matteo</div></div></div>