Skip to content

cumulative sum by group and under some criteria

1 message · arun

#
Hello,
The expansion was based on the unique values of m1 and n1 in dataset d3.? I guess that is the way it works for expansion.

I am not sure what kind of results you are expecting.? 
Even the code that you provided will also give the combination of m1=3 and n1=3.? 
As I mentioned in the earlier reply, if you don't want the combination of m1=3 and n1=3 in the expanded dataset, 
use type="inner" in ?join().
library(plyr)
res2<- join(res1,d3,by=c("m1","n1"),type="inner")

A.K.