If you want pairwise correlations for the cols of matrix x and N
is some parameter to your routine that does not vary throughout
the calculation then:
apply(x,2,function(a)apply(x,2,function(b)Transmer.cor(a,b,N)))
Replace both occurrences of 2 with 1 if you want rows.
Ruedi Epple <ruedi.epple <at> bluewin.ch> writes:
:
: Hi,
: I have begun to use R some months ago. I have solved many problems, but now
: I do not reach my aim.
: I have written a function ?Tranmer.cor? with the parameters x, y and N, which
: calculates weighted correlation coefficients. It works, when I define the
: parameters each time I want to run it. But I cannot tell ?Tranmer.cor? that
: it works trough a whole matrix, so that I get a correlation matrix with all
: the combinations of variables I have in my data.frame.
: There must be a little thing that I have not checked yet.
: Thanks for your advice.
: Ruedi Epple
:
: ------------------------
: Dr. Ruedi Epple
: Stebligerweg 4
: CH-4450 Sissach
: 061/971 67 15
: ruedi.epple <at> bluewin.ch
: ruedi.epple <at> bfs.admin.ch
: