Re: [R] R-help

About this list Date view Thread view Subject view Author view Attachment view

From: Gabor Grothendieck (ggrothendieck@myway.com)
Date: Sat 15 May 2004 - 00:16:50 EST


Message-id: <loom.20040514T160134-146@post.gmane.org>


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
:

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:10 EST