Skip to content
Prev 269109 / 398502 Next

display only the top-right half of a correlation matrix?

On Fri, Aug 19, 2011 at 12:32 PM, Liviu Andronic <landronimirc at gmail.com> wrote:
if as.dist doesn't work, use brute force:

x = matrix(rnorm(5*100), 100, 5)
mat = signif(cor(x), 2);
mat[lower.tri(mat)] = ""

data.frame(mat)

Peter