Skip to content

aggregate combination data

1 message · Rui Barradas

#
Hello,

Try the following.


fun <- function(x, k){
     n <- length(x)
     cmb <- combn(n, k)
     apply(cmb, 2, function(j) x[j])
}

uplot <- unique(dat$plot)
fun(uplot, 2)

Hope this helps,

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