[R] Symmetric matrix

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sun Sep 21 21:10:07 CEST 2008


Jorge Ivan Velez wrote:
> Dear Megh,
> Try this:
>
> a = matrix(rnorm(36), 6)
> a[upper.tri(a)]<-a[lower.tri(a)]
> a
>
>   
> HTH,
>
>   
If you look carefully, you'll see that it doesn't work! Dimitris had the 
better idea.

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



More information about the R-help mailing list