Skip to content

aggregate combination data

1 message · Rui Barradas

#
Hello,

This will give you a list of 19 elements, each element k is a matrix of 
all combinations of 19 taken k at a time.

cmb <- lapply(seq_len(nrow(dat)), function(k) combn(nrow(dat), k))
d <- dat[["d"]]
lapply(cmb, function(cc) apply(cc, 2, function(j) d[j]))


Hope this helps,

Rui Barradas
Em 14-11-2012 13:32, catalin roibu escreveu: