Re: [R] Using combn

2011-01-10 Thread Henrique Dallazuanna
Try this: combn(colnames(asd), 2, function(x)table(asd[x])) On Mon, Jan 10, 2011 at 2:34 PM, Patrick Hausmann < patrick.hausm...@uni-bremen.de> wrote: > Dear list, > > I want to apply the "table" function to every pair of variables in df and > the return should be a list. > > setwd(123) > asd <-

[R] Using combn

2011-01-10 Thread Patrick Hausmann
Dear list, I want to apply the "table" function to every pair of variables in df and the return should be a list. setwd(123) asd <- data.frame(a1=sample(1:4, 20, replace=TRUE), a2=sample(1:4, 20, replace=TRUE), a3=sample(1:4, 20, replace=TRUE),