[R] trouble with cumsum?

From: Makram Talih <talih_at_xena.hunter.cuny.edu>
Date: Mon 30 May 2005 - 10:17:13 EST


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 advance for any clarifications any of you can offer.

Regards,

Makram Talih

--
Makram Talih, Ph.D.
Assistant Professor
Department of Mathematics and Statistics
Hunter College of the City University of New York
695 Park Avenue, Room 905 HE
New York, NY 10021

Website: http://stat.hunter.cuny.edu/talih
E-mail: talih@math.hunter.cuny.edu
Tel: 212-772-5308
Fax: 212-772-4858

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon May 30 10:40:57 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:15 EST