R help document showed us that you should not use "==" for comparing
objects, and you will use "all.equal".
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Makram Talih
Sent: Monday, May 30, 2005 8:17 AM
To: r-help@stat.math.ethz.ch
On 29 May 2005 at 20:17, Makram Talih wrote:
| Dear R users,
|
| I am using R version 2.0.1 (2004/11/15) on an i386-pc-mingw32 platform. I
| encounter the following problem while using cumsum:
|
| > a <- rep(0.01, 100)
| > b <- cumsum(a)
| > sum(a) == 1
| [1] TRUE
| > b[100] == 1
| [1] FALSE
|
Dear R users,
I am using R version 2.0.1 (2004/11/15) on an i386-pc-mingw32 platform. I
encounter the following problem while using cumsum:
> a <- rep(0.01, 100)
> b <- cumsum(a)
> sum(a) == 1
[1] TRUE
> b[100] == 1
[1] FALSE
Am I missing something? Should cumsum have such an outcome?
Thanks in