-----Original Message-----
From: Christos Hatzis [mailto:christos at nuverabio.com]
Sent: Wednesday, February 07, 2007 2:16 PM
To: 'Leo G?rtler'; 'r-help at stat.math.ethz.ch'
Subject: RE: [R] blank upper or lower triangle of cor-matrix
You can try
as.dist(d)
Christos Hatzis, Ph.D.
Nuvera Biosciences, Inc.
400 West Cummings Park
Suite 5350
Woburn, MA 01801
Tel: 781-938-3830
www.nuverabio.com
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Leo G?rtler
Sent: Wednesday, February 07, 2007 1:36 PM
To: r-help at stat.math.ethz.ch
Subject: [R] blank upper or lower triangle of cor-matrix
Dear altogether,
I want to blank the lower (or upper) part of a correlation
it is done by dist()
example:
( d <- cor(matrix(runif(12),nrow=4)) )
If I do the following
d[lower.tri(d)] <- ""
of course everything is changed to character - that's not
be.
Additionally, it does not work to assign "0" or anything else. The
same is true for assigning "NA".
However, what I want is like the following:
( dist(matrix(runif(12),nrow=4)) )
Looking into dist(), it seems that the calculation and the
done in C and not in plain R.
How can I realize it?
thanks!
best,
leo