## Function on all column combinations of n*m matrix yielding a m*m result

Say I have a function which takes two vectors and returns a single integer, for instance the number of elements in one that is also in the other vector. Like:
f <- function(v1,v2)sum(v1 %in% v2)
How can I apply that function to all pairwise com...

more
»