On Wed, 12 Sep 2007, Robin Hankin wrote:
> Hello
>
>
> I have X, an n-by-n matrix and want to convert it to Y, an
> n(n-1)/2 -by- n matrix such that each row of Y
> corresponds to an element of the upper diagonal
> of X. Say row k of Y corresponds to [i,j] with i\neq j.
>
> Then Y[i,k] = X[i,j
m0390867/dimitris.htm
- Original Message -
From: "Robin Hankin" <[EMAIL PROTECTED]>
To: "R program"
Sent: Wednesday, September 12, 2007 4:32 PM
Subject: [R] vectorize a matrix conversion
> Hello
>
>
> I have X, an n-by-n matrix and want to convert
Hello
I have X, an n-by-n matrix and want to convert it to Y, an
n(n-1)/2 -by- n matrix such that each row of Y
corresponds to an element of the upper diagonal
of X. Say row k of Y corresponds to [i,j] with i\neq j.
Then Y[i,k] = X[i,j] and Y[j,k] = X[j,i].
and Y[-c(i,j),k] = NA.
How to do
3 matches
Mail list logo