[R] splitting a square symmetric matrix

Erik Iverson eriki at ccbr.umn.edu
Thu Jan 20 22:32:39 CET 2011

Joe P King wrote:
> So many matrices are square symmetrical (i.e. variance-covariance matrices),
> is there any way to get R to split the matrix on its diagonal and just
> return one diagonal?

> mat<-matrix(c(1,4,3,4,1,2,3,2,1), nrow = 3, ncol=3, byrow=TRUE)
> is there anyway to get the lower right diagonal instead of the entire
> symmetric matrix?

Is ?lower.tri what you're looking for?

More information about the R-help mailing list