On Thu, 23 Sep 2004 13:08:53 -0500, "Mark Strivens"
<[EMAIL PROTECTED]> wrote :

>Is there a simple way to decompose the upper triangle
>of a correlation matrix to a linear list;
>
>For example:
>
>  X Y Z
>X 1 2 3
>Y 2 1 4
>Z 3 4 1
>
>so you get a list like:
>
>xy 2
>XZ 3
>YZ 4
>
>I suspect you can do it with a matrix transformation, but
>that beyond me at present.

x[ row(x) < col(x) ]

will give the entries you want.

Duncan Murdoch

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

Reply via email to