s-news
[Top] [All Lists]

Re: constructing a symmetric matrix

To: sundar.dorai-raj@PDF.COM
Subject: Re: constructing a symmetric matrix
From: "Joseph S. Verducci" <jsv@stat.ohio-state.edu>
Date: Mon, 18 Oct 2004 10:18:16 -0400
Cc: Laura Holt <lauraholt_983@hotmail.com>, s-news@lists.biostat.wustl.edu
In-reply-to: <4173CB09.8000907@pdf.com>
References: <BAY12-F6Byh133tYwli0002388c@hotmail.com> <4173C932.9060907@pdf.com> <4173CB09.8000907@pdf.com>
x[lower.tri(x)] <- t(x)[lower.tri(x)]

______________________________

On Mon, 2004-10-18 at 09:54, Sundar Dorai-Raj wrote:
> Laura,
>    Sorry, my answer doesn't work. copying is not done as I expected.
> 
> Dimitris' answer works.
> 
> --sundar
> 
> Sundar Dorai-Raj wrote:
> 
> > 
> > 
> > Laura Holt wrote:
> > 
> >> Dear S + People:
> >>
> >> I am constructing a symmetric matrix.  I have the upper part calculated.
> >>
> >> Is there a quick way to "copy" the upper part over to the lower part, 
> >> please?
> >> (other than for loop)
> >> S + v6.2 Windows.
> >>
> >> Thanks,
> >> Sincerely,
> >> Laura Holt
> >> mailto: lauraholt_983@hotmail.com
> > 
> > 
> > 
> > Laura,
> > 
> > Try this:
> > 
> > upper.tri <- row(x) < col(x)
> > lower.tri <- row(x) > col(x)
> > x[lower.tri] <- x[upper.tri]
> > 
> > --sundar
> > 
> > 
> > --------------------------------------------------------------------
> > This message was distributed by s-news@lists.biostat.wustl.edu.  To
> > unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> > the BODY of the message:  unsubscribe s-news
> 
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>