?cumsum
> x <- table(cut(AGE, b=c(0,39,49,59,69,79,89)))
> x
(0,39] (39,49] (49,59] (59,69] (69,79] (79,89]
24 38 41 37 26 34
> cumsum(x)
(0,39] (39,49] (49,59] (59,69] (69,79] (79,89]
24 62 103 140 166 200
>
On 9/25/07, Chung-hong Chan
Dear R gurus,
I think this question is very trivial, but I search around the HELP
file and this maillist can come up with no answer. Suppose I have a
vector called AGE like this
> sort(AGE)
[1] 30 34 35 37 37 38 38 38 38 39 39 40 40 42 42 43 43 43 43 43 43 44
[23] 44 44 44 44 44 44 45 45 45 46
2 matches
Mail list logo