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
|