Thanks guys for the help, here's the final (grizzly?)
solution:
#generate a correlation matrix
cm<-cor(someDataFrame, y = NULL ...)
# get the list of labels (included in the dataframe)
labels<-labels(cm)[[1]]
# retrieve the uppper portion of the correlation matrix (as logical values)
idx <- uppe
On 23-Sep-04 Mark Strivens 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 transfor
> From: Mark Strivens
>
> Thanks for the answers the appear to be just
> right.
>
> i.e.
>
> corrmat[upper.tri(corrmat)]
>
> or
>
> x[col(x)>row(x)]
>
> The slight problem is I lose all the column &
> row labels from the correlation matrix, so I
> am not sure of the order of the values (i
> From: Duncan Murdoch
>
> 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 ge
Thanks for the answers the appear to be just
right.
i.e.
corrmat[upper.tri(corrmat)]
or
x[col(x)>row(x)]
The slight problem is I lose all the column &
row labels from the correlation matrix, so I
am not sure of the order of the values (i.e.
which combination of markers the value
represent
]
> y
[1] 5 9 10 13 14 15
>
bob
-Original Message-
From: Mark Strivens [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 23, 2004 2:09 PM
To: [EMAIL PROTECTED]
Subject: [R] decompose a correlation matrix
Is there a simple way to decompose the upper triangle
of a correlation
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 ca
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.
Many thanks
Mark
__