[R] sample() issue

2010-12-20 Thread cory n
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

Re: [R] sample() issue

2010-12-20 Thread David Winsemius
On 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

Re: [R] sample() issue

2010-12-20 Thread Viechtbauer Wolfgang (STAT)
, December 20, 2010 20:04 To: r-help@r-project.org Subject: [R] sample() issue 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

Re: [R] sample() issue

2010-12-20 Thread Peter Langfelder
On Mon, Dec 20, 2010 at 11:04 AM, cory n corynis...@gmail.com 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

Re: [R] sample() issue

2010-12-20 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of cory n Sent: Monday, December 20, 2010 11:04 AM To: r-help@r-project.org Subject: [R] sample() issue length(sample(25000, 25000*(1-.55))) [1] 11249 25000*(1-.55) [1

Re: [R] sample() issue

2010-12-20 Thread Jorge Ivan Velez
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]

Re: [R] sample() issue

2010-12-20 Thread Viechtbauer Wolfgang (STAT)
] 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

Re: [R] sample() issue

2010-12-20 Thread Petr Savicky
On Mon, Dec 20, 2010 at 01:04:18PM -0600, cory n wrote: length(sample(25000, 25000*(1-.55))) [1] 11249 25000*(1-.55) [1] 11250 Besides FAQ 7.31, look also at http://rwiki.sciviews.org/doku.php?id=misc:r_accuracy for further examples and hints concerning rounding errors in simple