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

Chu-Lan Kao chu|@nk@o @end|ng |rom gm@||@com
Thu Feb 21 07:52:58 CET 2019


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<double> distribution (0.0, 1.0);
  return (distribution(generator));
}

But as I uploaded, the system ask me to remove rand(). Various attempt has
been tried, but all of them result in no randomness at all. Not sure how to
fix it. Kindly appreciate all helps.

Sincerely,

Chu-Lan Kao ( 高竹嵐 Michael )
*http://chulankao.blogspot.com / <http://chulankao.blogspot.com/>*
ChuLanKao using gmail.com
<http://chulankao.blogspot.com%20/%20ChuLanKao@gmail.com> / 0956242509

Assist. Prof. in Statistics, National Chiao-Tung University
Music Director for dramAcappella Theater
<https://www.facebook.com/dramAcappella>
Composer, Taipei Philaharmonic Chorus <http://www.tpf.org.tw/index.php>
Gamer Consultant and Designer

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list