Skip to content

cumulative sum by group and under some criteria

1 message · arun

#
Hi,Another thing you could do will be to use ?paste()
#for example.
#d3 dataset

?paste(d3$m1,d3$n1)
#[1] "2 2" "3 2" "2 3"

#then you use that instead of unique(d3$m1), unique(d3$n1) in the loop.
I didn't try it.? But, that is one possibility.

You still didn't show me the results you expected in the expansion.? So, I am not sure about how it will look like.
A.K.