[R] `bivariate apply'

Vito Muggeo vito.muggeo at giustizia.it
Tue Dec 16 14:13:29 CET 2003


dear all,

Given a matrix A, say, I would like to apply a bivariate function to each
combination of its colums. That is if

myfun<-function(x,y)cor(x,y) #computes simple correlation of two vectors x
and y

then the results should be something similar to cor(A).

I tried with mapply, outer,...but without success

Can anybody help me?

many thanks in advance,
vito




More information about the R-help mailing list