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
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
, 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
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
-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
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]
] 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
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
8 matches
Mail list logo