Skip to content
Prev 32386 / 398513 Next

extract half a matrix

Dear Tord,
At 04:55 PM 5/22/2003 +0200, Tord Snall wrote:

            
If you want the result as a one-column matrix, 
as.matrix(mat[upper.tri(mat)]) will do the trick.

John


-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox