Skip to content
Prev 6023 / 10988 Next

[Rcpp-devel] Setting the R random seed from Rcpp

Hi Matteo,

I do not know what you really want to do, but if you want to replicate results, you could do the following in Rcpp before running the RNG:

Rcpp::Environment baseEnv("package:base");
Rcpp::Function setSeed = baseEnv["set.seed"];
setSeed(0);    //any other number would do it here


Best
Simon
On Jun 7, 2013, at 4:22 PM, Matteo Fasiolo <matteo.fasiolo at gmail.com> wrote: