Is this you want? apply(apply(perms, 1, as.logical), 2, function(x)df[x])
On 14/01/2008, Serguei Kaniovski <[EMAIL PROTECTED]> wrote: > Henrique, I know I have to use "apply", but how do I select the columns of > the dataframe using the permutation vectors produced by > > nvar <- ncol(dat) - 1 > perms <- as.matrix( expand.grid(rep( list(1:0) , nvar ))[ , nvar:1] ) > > Serguei > > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.