[Rcpp-devel] Setting seed using Rcpp

Hao Ye hye at ucsd.edu
Wed Feb 7 16:44:03 CET 2018


Hi Youssef,

Rcpp has sugar for the R random number generators. This is nice if you want
to let your users set the random seed in R code outside of the package for
reproducibility: http://gallery.rcpp.org/articles/random-number-generation/

Alternatively, if you enable C++11, there are some random number generators
in std: https://www.guyrutenberg.com/2014/05/03/c-mt19937-example/

Best,
--
Hao Ye

On Wed, Feb 7, 2018 at 10:20 AM, Hmamouche Youssef <
hmamoucheyussef at gmail.com> wrote:

> Hi,
>
> I get a note from R CMD check for an Rcpp package:
>
>   Found ‘_srand’, possibly from ‘srand’
>
>  Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols’
>
>
> Is there some an  equivalent function for srand from Rcpp, which i can
> use it inside c++ code?
>
> Best regards,
> Youssef
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20180207/b750f01c/attachment.html>


More information about the Rcpp-devel mailing list