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.

----- Original Message -----
From: Prof Brian Ripley <[EMAIL PROTECTED]>
Date: Monday, May 14, 2007 9:40 pm
Subject: Re: [Rd] set_seed
To: Tong Wang <[EMAIL PROTECTED]>
Cc: R-devel <r-devel@r-project.org>

> 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,                  [EMAIL PROTECTED]
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to