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 <-
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),
2 matches
Mail list logo