Skip to content

cumulative sum by group and under some criteria

2 messages · arun, Zjoanna

#
Hi,

Anyway, just using some random combinations:
?dnew<- expand.grid(4:10,5:10,6:10,3:7,4:5,6:8)
names(dnew)<-c("m","n","x1","y1","x","y")
resF<- cbind(dnew,d2[rep(1:nrow(d2),nrow(dnew)),])

?row.names(resF)<- 1:nrow(resF)
?head(resF)
# ?m n x1 y1 x y m1 n1 cterm1_P1L cterm1_P0H
#1 4 5 ?6 ?3 4 6 ?3 ?2 ? ?0.00032 ? ? 0.0025
#2 5 5 ?6 ?3 4 6 ?3 ?2 ? ?0.00032 ? ? 0.0025
#3 6 5 ?6 ?3 4 6 ?3 ?2 ? ?0.00032 ? ? 0.0025
#4 7 5 ?6 ?3 4 6 ?3 ?2 ? ?0.00032 ? ? 0.0025
#5 8 5 ?6 ?3 4 6 ?3 ?2 ? ?0.00032 ? ? 0.0025
#6 9 5 ?6 ?3 4 6 ?3 ?2 ? ?0.00032 ? ? 0.0025

?nrow(resF)
#[1] 6300
I am not sure what you want to do with this.
A.K.
4 days later