Skip to content
Prev 285510 / 398503 Next

built a lower triangular matrix from dataframe

Hi Rui,

Thank you very much for your idea. It works!!!

I converted my dataframe into a vector (I first removed the header and the
first and second column) and then tried your solution:
[1] 5.2 9.1 8.0 2.3 8.4 6.6 7.4 7.1 5.5 4.1 3.9 9.2 8.5 7.6 9.9
[,1] [,2] [,3] [,4] [,5] [,6]
[1,]    0  5.2  9.1  2.3  7.4  3.9
[2,]    0  0.0  8.0  8.4  7.1  9.2
[3,]    0  0.0  0.0  6.6  5.5  8.5
[4,]    0  0.0  0.0  0.0  4.1  7.6
[5,]    0  0.0  0.0  0.0  0.0  9.9
[6,]    0  0.0  0.0  0.0  0.0  0.0

Perfect!
:)

--
View this message in context: http://r.789695.n4.nabble.com/built-a-lower-triangular-matrix-from-dataframe-tp4390813p4393562.html
Sent from the R help mailing list archive at Nabble.com.