Skip to content
Prev 280842 / 398503 Next

Help creating a symmetric matrix?

Matt Considine wrote
Hello,

Aren't you complicating?

In the last line of your code, why use 'v[ind]' if 'ind' indexes the matrix,
not the vector?

z<-diag(6)
ind <- lower.tri(z)
z[ind] <- v                        #This works
z

Rui Barradas


--
View this message in context: http://r.789695.n4.nabble.com/Help-creating-a-symmetric-matrix-tp4227301p4230335.html
Sent from the R help mailing list archive at Nabble.com.