Re: [R] Converting from density to cumulative distribution

2011-04-21 Thread jim holtman
?cumsum > x = c(1,3,2,2,5) > cumsum(x) [1] 1 4 6 8 13 > On Thu, Apr 21, 2011 at 11:05 AM, Parodi, Pietro wrote: > > Hello > > I'm trying to do the following vector operation: > > given vector x = c(x1,x2,x3,x4...xn),  produce vector y = > c(x1,x1+x2,x1+x2+x3,...x1+...+xn). > > E.g.,  from x

[R] Converting from density to cumulative distribution

2011-04-21 Thread Parodi, Pietro
Hello I'm trying to do the following vector operation: given vector x = c(x1,x2,x3,x4...xn), produce vector y = c(x1,x1+x2,x1+x2+x3,...x1+...+xn). E.g., from x = c(1,3,2,2,5), produce y = c(1,4,6,8,13). The underlying problem is finding the cumulative distribution function given the em