Creating a symmetric matrix in R

s<-matrix(1:25,5)
s[lower.tri(s)] = t(s)[lower.tri(s)]

Leave a Comment