[R] sample() issue

Viechtbauer Wolfgang (STAT) wolfgang.viechtbauer at maastrichtuniversity.nl
Mon Dec 20 21:01:01 CET 2010


Trying to make the fastest referal to FAQ 7.31 is becoming quite a sport around here. David beat us all to it on this round. Chances are there will be many more rounds to come.

Best,

Wolfgang

----Original Message----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Jorge Ivan Velez Sent: Monday, December 20, 2010 20:42
To: cory n
Cc: R mailing list
Subject: Re: [R] sample() issue

> Hi Cory,
>
> Check out
> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
>
> HTH,
> Jorge
>
>
> On Mon, Dec 20, 2010 at 2:04 PM, cory n <> wrote:
>
>>> length(sample(25000, 25000*(1-.55)))
>> [1] 11249
>>
>>> 25000*(1-.55)
>> [1] 11250
>>
>>> length(sample(25000, 11250))
>> [1] 11250
>>
>>> length(sample(25000, 25000*.45))
>> [1] 11250
>>
>> So the question is, why do I get 11249 out of the first command and not
>> 11250?  I can't figure this one out.
>>
>> Thanks
>>
>> Cory



More information about the R-help mailing list