Skip to content
Prev 317897 / 398506 Next

cumulative sum by group and under some criteria

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.
Message-ID: <1361293110.24288.YahooMailNeo@web142605.mail.bf1.yahoo.com>
In-Reply-To: <CACexUkvcuqduZ9_Z9XWQJe3Cj-FfbKF8e_qHagJYZ=QZbzrkhA@mail.gmail.com>