Hello,
I have a dataframe with values for Ages from 0 to 110 and I would like to create a new dataframe or to add a column in my existing one summing the values of one column.
For example : For age = 2 I want the value to be the sum of the values for age=0,1 and 2 of my existing data and for age = 110 I want it to be the sum of the whole values of my existing data.
I tried this code but all I get is an empty vector.
i <- 0
repeat {
p_lifetable_1955 <-cumsum (data1955$Fem_px[0 : i])
i <- i + 1
if(i == 111) break
}
Could someone tell me what is going wrong?
Thanks in advance