Re: [R-pkg-devel] Problem on rand() in packaging

2019-02-21 Thread Ralf Stubner
On 21.02.19 09:16, Uwe Ligges wrote: > Use R's RNG, see Writing R Extensions. Which can be conveniently used with R::runif and Rcpp::runif etc. when using Rcpp. cheerio ralf > Best, > Uwe Ligges > > > On 21.02.2019 07:52, Chu-Lan Kao wrote: >> Dear Sir, >> >> I've got a Rcpp code in the form l

Re: [R-pkg-devel] Problem on rand() in packaging

2019-02-21 Thread Uwe Ligges
Use R's RNG, see Writing R Extensions. Best, Uwe Ligges On 21.02.2019 07:52, Chu-Lan Kao wrote: Dear Sir, I've got a Rcpp code in the form like the following in my uploaded package: inline double runiforminline(){ std::default_random_engine generator(rand()); std::uniform_real_distribu

[R-pkg-devel] Problem on rand() in packaging

2019-02-20 Thread Chu-Lan Kao
Dear Sir, I've got a Rcpp code in the form like the following in my uploaded package: inline double runiforminline(){ std::default_random_engine generator(rand()); std::uniform_real_distribution distribution (0.0, 1.0); return (distribution(generator)); } But as I uploaded, the system ask