Displaying 1 result from an estimated 1 matches for "generatedistmat".
2007 Feb 09
2
heatmap color specification
hi,
I have a positive integer matrix like:
test<-matrix(c(1,2,2,2,2,1,1,2,3),3)
and based on the distant function I made like this:
generateDistMat<-function (target)
{
n <- nrow(target)
rn <- rownames(target)
distM <- matrix(NA, n, n)
diag(distM) <- 0
for (i in 1:(n - 1)) for (j in (i + 1):n) {
distM[i, j] <- length(which(target[i, ] != target[j,
]))
distM[j, i] <- distM[i,...