From maechler at stat.math.ethz.ch  Wed Oct 22 11:45:31 2003
From: maechler at stat.math.ethz.ch (maechler@stat.math.ethz.ch)
Date: Wed Oct 22 11:44:29 2003
Subject: [Rd] Random Number Generator RNGkind() under "R CMD check"
	(PR#4691)
Message-ID: <200310220945.h9M9jV0P009182@pubhealth.ku.dk>

>>>>> "WoHub" == w huber <w.huber@dkfz.de>
>>>>>     on Mon, 20 Oct 2003 22:15:04 +0200 (MET DST) writes:

    WoHub> Full_Name: Wolfgang Huber
    WoHub> Version: 1.8.0
    WoHub> OS: Linux
    WoHub> Submission from: (NULL) (193.174.58.146)


    WoHub> The man page for RNGkind says that the default is
    WoHub> Mersenne-Twister, and when I start R interactively, I
    WoHub> get in fact

    >> RNGkind()
    WoHub> [1] "Mersenne-Twister" "Inversion"

    WoHub> However, during the execution of "R CMD check" I get
    >> > ### ** Examples
    >> >
    >> >  RNGkind()
    >> [1] "Wichmann-Hill" "Inversion"

    WoHub> This creates discrepancies between the behaviour of
    WoHub> code that uses pseudo random numbers during "check"
    WoHub> and otherwise.

yes, but this has been so on purpose "forever".
If you really want reproducible example using random numbers
you must set both RNGkind() and set.seed().

I'd agree that this should be documented -- and further, we tend
to agree that we should consider changing the current behavior,
probably to something like
	 RNGkind("default","default"); set.seed(1)
{in the cleanupEx() function called before each example}.

But note again: You still may see "discrepancies" between the "R
CMD check" and the normal usage, unless you call at least
set.seed(.) yourself in your example.

Martin Maechler <maechler@stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><


[Rd] Random Number Generator RNGkind() under "R CMD check" (PR#4691)
maechler@stat.math.ethz.ch