Difference between revisions of "Cluster.R"

From Organic Design wiki
(Function body)
(image plot)
Line 8: Line 8:
 
    
 
    
 
# 2) Image plot...   
 
# 2) Image plot...   
 
+
  image(x = 1:nrow(x), y = 1:ncol(x) z = x[xClust$order, ])
 
   par(oldpar)
 
   par(oldpar)
 
   invisible()
 
   invisible()
 
}
 
}

Revision as of 20:47, 11 November 2006

clusterPlot <- function(x, dmethod = "euclidian", hmethod="complete", ...) {

 oldpar <- par(mfrow=c(2,1))  
 xDist <- dist(x, method=dmethod)
 
  1. 1) Tree dendrogram
 xClust <- hclust(xDist)
 plclust(xDist)
 
  1. 2) Image plot...
 image(x = 1:nrow(x), y = 1:ncol(x) z = x[xClust$order, ])
 par(oldpar)
 invisible()

}