n Jones
> > Sent: Thursday, May 23, 2013 8:30 AM
> > To: r-help@r-project.org
> > Subject: Re: [R] sample(c(0, 1)...) vs. rbinom
> >
> > After a bit of playing around, I discovered that
> > sample() does something similar in other situations:
> >
&g
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Albyn Jones
> Sent: Thursday, May 23, 2013 8:30 AM
> To: r-help@r-project.org
> Subject: Re: [R] sample(c(0, 1)...) vs. rbinom
>
> After a bit of play
After a bit of playing around, I discovered that
sample() does something similar in other situations:
set.seed(105021)
sample(1:5,1,prob=c(1,1,1,1,1))
[1] 3
set.seed(105021)
sample(1:5,1)
[1] 2
set.seed(105021)
sample(1:5,5,prob=c(1,1,1,1,1))
[1] 3 4 2 1 5
set.seed(105021)
sample(1:5,5)
On May 23, 2013, at 07:01 , Jeff Newmiller wrote:
> You seem to be building an elaborate structure for testing the
> reproducibility of the random number generator. I suspect that rbinom is
> calling the random number generator a different number of times when you pass
> prob=0.5 than otherwis
You seem to be building an elaborate structure for testing the reproducibility
of the random number generator. I suspect that rbinom is calling the random
number generator a different number of times when you pass prob=0.5 than
otherwise.
-
5 matches
Mail list logo