On Fri, Aug 19, 2011 at 12:32 PM, Liviu Andronic <landronim...@gmail.com> wrote: > On Fri, Aug 19, 2011 at 9:02 PM, Peter Langfelder > <peter.langfel...@gmail.com> wrote: >> Use as.dist: here's an example. >> > Seems promising, but for one issue: I would like to keep the diagonal > and thus specify 'diag=T', but then as.dist() replaces the diagonal > values with zero. (See below.) Is there a way to prevent it from doing > that? Either keep the original values, or not display anything in the > diagonal (as for the upper part)?
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 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.