Re: [Rd] set_seed

From: Tong Wang <>
Date: Mon, 14 May 2007 23:01:34 -0700

  In this case, how do I choose numbers to make sure set_seed(n1,n2) and set.seed(n) produce the same result ? I am asking because my C code worked correctly if I compile it to produce .exe file and ran it , but it gave strange results if it is compiled to .dll file and dynamically loaded into R and call with .C( ).

   To debug, I need to let them produce the same random number under two different situation so I can tell what is wrong in R.

   Thanks a lot.

> On Mon, 14 May 2007, Tong Wang wrote:
> > Hi, All:
> > It seemed set_seed is usable only when Rmath is used as a
> standalone
> > library, then what should I use when I need to link to R.dll.
> When you link to R.dll you are running R, so you can call
> set.seed() via
> eval or via do_setseed.
> --
> Brian D. Ripley,
> Professor of Applied Statistics,
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595
> mailing list Received on Tue 15 May 2007 - 06:04:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 May 2007 - 06:33:14 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.