R version 2.6.0 (2007-10-03) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(106.22 + ,103.7 + ,107.97 + ,106.31 + ,103.75 + ,108.13 + ,107.38 + ,103.85 + ,108.54 + ,109.31 + ,104.02 + ,109.86 + ,110.82 + ,104.13 + ,109.75 + ,111.22 + ,104.17 + ,109.99 + ,110.66 + ,104.18 + ,112.01 + ,110.76 + ,104.2 + ,111.96 + ,110.69 + ,104.5 + ,111.41 + ,111.08 + ,104.78 + ,112.11 + ,110.97 + ,104.88 + ,111.67 + ,110.24 + ,104.89 + ,111.95 + ,112.51 + ,104.9 + ,112.31 + ,111.52 + ,104.95 + ,113.26 + ,112.13 + ,105.24 + ,113.5 + ,112.23 + ,105.35 + ,114.43 + ,112.92 + ,105.44 + ,115.02 + ,111.89 + ,105.46 + ,115.1 + ,111.99 + ,105.47 + ,117.11 + ,111.51 + ,105.48 + ,117.52 + ,112.33 + ,105.75 + ,116.1 + ,112.04 + ,106.1 + ,116.39 + ,112.09 + ,106.19 + ,116.01 + ,111.41 + ,106.23 + ,116.74 + ,112.61 + ,106.24 + ,116.68 + ,113.14 + ,106.25 + ,117.45 + ,113.65 + ,106.35 + ,117.8 + ,114.26 + ,106.48 + ,119.37 + ,114.4 + ,106.52 + ,118.9 + ,114.93 + ,106.55 + ,119.05 + ,114.86 + ,106.55 + ,120.46 + ,114.95 + ,106.56 + ,120.99 + ,116.17 + ,106.89 + ,119.86 + ,114.6 + ,107.09 + ,120.18 + ,114.62 + ,107.24 + ,119.81 + ,113.82 + ,107.28 + ,120.15 + ,115.02 + ,107.3 + ,119.8 + ,115.18 + ,107.31 + ,120.27 + ,115.59 + ,107.47 + ,120.71 + ,116.6 + ,107.35 + ,121.87 + ,117.07 + ,107.31 + ,121.87 + ,116.96 + ,107.32 + ,121.92 + ,116.66 + ,107.32 + ,123.72 + ,116.07 + ,107.34 + ,124.38 + ,116.04 + ,107.53 + ,123.21 + ,115.81 + ,107.72 + ,123.17 + ,116.22 + ,107.75 + ,122.95 + ,115.85 + ,107.79 + ,123.46 + ,116.43 + ,107.81 + ,123.24 + ,117.39 + ,107.9 + ,123.86 + ,119.17 + ,107.8 + ,124.28 + ,119.24 + ,107.86 + ,124.78 + ,120.03 + ,107.8 + ,125.19 + ,119.34 + ,107.74 + ,125.46 + ,118.49 + ,107.75 + ,127.6 + ,118.59 + ,107.83 + ,127.8 + ,117.5 + ,107.8 + ,126.63 + ,117.56 + ,107.81 + ,127.06 + ,118.25 + ,107.86 + ,126.77 + ,118.01 + ,107.83 + ,127.05) + ,dim=c(3 + ,60) + ,dimnames=list(c('V&D' + ,'K&S' + ,'HCR') + ,1:60)) > y <- array(NA,dim=c(3,60),dimnames=list(c('V&D','K&S','HCR'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par4 = 'FALSE' > par3 = 'FALSE' > par2 = 'ALL' > par1 = 'ward' > ylab = 'height' > xlab = 'cases' > main = 'Dendrogram' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa, P., (2007), Hierarchical Clustering (v1.0.1) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_hierarchicalclustering.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > par3 <- as.logical(par3) > par4 <- as.logical(par4) > if (par3 == 'TRUE'){ + dum = xlab + xlab = ylab + ylab = dum + } > x <- t(y) > hc <- hclust(dist(x),method=par1) > d <- as.dendrogram(hc) > str(d) --[dendrogram w/ 2 branches and 60 members at h = 212] |--[dendrogram w/ 2 branches and 25 members at h = 44] | |--[dendrogram w/ 2 branches and 13 members at h = 11.7] | | |--[dendrogram w/ 2 branches and 7 members at h = 2.44] | | | |--[dendrogram w/ 2 branches and 4 members at h = 0.916] | | | | |--leaf "25" | | | | `--[dendrogram w/ 2 branches and 3 members at h = 0.568] | | | | |--leaf "21" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.394] | | | | |--leaf "22" | | | | `--leaf "23" | | | `--[dendrogram w/ 2 branches and 3 members at h = 1.20] | | | |--leaf "24" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.631] | | | |--leaf "19" | | | `--leaf "20" | | `--[dendrogram w/ 2 branches and 6 members at h = 3.92] | | |--[dendrogram w/ 2 branches and 3 members at h = 1.04] | | | |--leaf "17" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.76] | | | |--leaf "16" | | | `--leaf "18" | | `--[dendrogram w/ 2 branches and 3 members at h = 1.54] | | |--leaf "13" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.717] | | |--leaf "14" | | `--leaf "15" | `--[dendrogram w/ 2 branches and 12 members at h = 18.6] | |--[dendrogram w/ 2 branches and 3 members at h = 1.57] | | |--leaf "3" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.190] | | |--leaf "1" | | `--leaf "2" | `--[dendrogram w/ 2 branches and 9 members at h = 6.08] | |--[dendrogram w/ 2 branches and 6 members at h = 1.22] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.114] | | | |--leaf "7" | | | `--leaf "8" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.915] | | |--leaf "12" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.77] | | |--leaf "9" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.464] | | |--leaf "10" | | `--leaf "11" | `--[dendrogram w/ 2 branches and 3 members at h = 2.14] | |--leaf "4" | `--[dendrogram w/ 2 branches and 2 members at h = 0.468] | |--leaf "5" | `--leaf "6" `--[dendrogram w/ 2 branches and 35 members at h = 62.5] |--[dendrogram w/ 2 branches and 14 members at h = 7.58] | |--[dendrogram w/ 2 branches and 9 members at h = 2.28] | | |--[dendrogram w/ 2 branches and 5 members at h = 1.39] | | | |--leaf "36" | | | `--[dendrogram w/ 2 branches and 4 members at h = 0.734] | | | |--[dendrogram w/ 2 branches and 2 members at h = 0.4] | | | | |--leaf "34" | | | | `--leaf "35" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.497] | | | |--leaf "37" | | | `--leaf "38" | | `--[dendrogram w/ 2 branches and 4 members at h = 1.90] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.538] | | | |--leaf "31" | | | `--leaf "32" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.18] | | |--leaf "33" | | `--leaf "39" | `--[dendrogram w/ 2 branches and 5 members at h = 3.72] | |--[dendrogram w/ 2 branches and 2 members at h = 0.627] | | |--leaf "26" | | `--leaf "27" | `--[dendrogram w/ 2 branches and 3 members at h = 0.701] | |--leaf "30" | `--[dendrogram w/ 2 branches and 2 members at h = 0.492] | |--leaf "28" | `--leaf "29" `--[dendrogram w/ 2 branches and 21 members at h = 28.4] |--[dendrogram w/ 2 branches and 11 members at h = 5.76] | |--[dendrogram w/ 2 branches and 3 members at h = 0.517] | | |--leaf "40" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.121] | | |--leaf "41" | | `--leaf "42" | `--[dendrogram w/ 2 branches and 8 members at h = 2.52] | |--[dendrogram w/ 2 branches and 5 members at h = 0.799] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.363] | | | |--leaf "47" | | | `--leaf "49" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.372] | | |--leaf "45" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.301] | | |--leaf "46" | | `--leaf "48" | `--[dendrogram w/ 2 branches and 3 members at h = 1.35] | |--leaf "50" | `--[dendrogram w/ 2 branches and 2 members at h = 0.885] | |--leaf "43" | `--leaf "44" `--[dendrogram w/ 2 branches and 10 members at h = 9.73] |--[dendrogram w/ 2 branches and 4 members at h = 1.39] | |--[dendrogram w/ 2 branches and 2 members at h = 0.508] | | |--leaf "51" | | `--leaf "52" | `--[dendrogram w/ 2 branches and 2 members at h = 0.743] | |--leaf "53" | `--leaf "54" `--[dendrogram w/ 2 branches and 6 members at h = 2.26] |--[dendrogram w/ 2 branches and 2 members at h = 0.237] | |--leaf "55" | `--leaf "56" `--[dendrogram w/ 2 branches and 4 members at h = 0.912] |--[dendrogram w/ 2 branches and 2 members at h = 0.37] | |--leaf "59" | `--leaf "60" `--[dendrogram w/ 2 branches and 2 members at h = 0.434] |--leaf "57" `--leaf "58" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1gbjk1194288636.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > if (par4 == 'TRUE'){ + plot(d,main=main,ylab=ylab,xlab=xlab,horiz=par3, nodePar=list(pch = c(1,NA), cex=0.8, lab.cex = 0.8),type='t',center=T, sub=mysub) + } else { + plot(d,main=main,ylab=ylab,xlab=xlab,horiz=par3, nodePar=list(pch = c(1,NA), cex=0.8, lab.cex = 0.8), sub=mysub) + } > dev.off() null device 1 > if (par2 != 'ALL'){ + if (par3 == 'TRUE'){ + ylab = 'cluster' + } else { + xlab = 'cluster' + } + par2 <- as.numeric(par2) + memb <- cutree(hc, k = par2) + cent <- NULL + for(k in 1:par2){ + cent <- rbind(cent, colMeans(x[memb == k, , drop = FALSE])) + } + hc1 <- hclust(dist(cent),method=par1, members = table(memb)) + de <- as.dendrogram(hc1) + postscript(file="/var/www/html/rcomp/tmp/2qdc71194288636.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + if (par4 == 'TRUE'){ + plot(de,main=main,ylab=ylab,xlab=xlab,horiz=par3, nodePar=list(pch = c(1,NA), cex=0.8, lab.cex = 0.8),type='t',center=T, sub=mysub) + } else { + plot(de,main=main,ylab=ylab,xlab=xlab,horiz=par3, nodePar=list(pch = c(1,NA), cex=0.8, lab.cex = 0.8), sub=mysub) + } + dev.off() + str(de) + } > load(file='/var/www/html/rcomp/createtable') > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Summary of Dendrogram',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Label',header=TRUE) > a<-table.element(a,'Height',header=TRUE) > a<-table.row.end(a) > num <- length(x[,1])-1 > for (i in 1:num) + { + a<-table.row.start(a) + a<-table.element(a,hc$labels[i]) + a<-table.element(a,hc$height[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/3s82p1194288637.tab") > if (par2 != 'ALL'){ + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Summary of Cut Dendrogram',2,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Label',header=TRUE) + a<-table.element(a,'Height',header=TRUE) + a<-table.row.end(a) + num <- par2-1 + for (i in 1:num) + { + a<-table.row.start(a) + a<-table.element(a,i) + a<-table.element(a,hc1$height[i]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/45jav1194288638.tab") + } > > system("convert tmp/1gbjk1194288636.ps tmp/1gbjk1194288636.png") > system("convert tmp/2qdc71194288636.ps tmp/2qdc71194288636.png") convert: unable to open image `tmp/2qdc71194288636.ps': No such file or directory. convert: missing an image filename `tmp/2qdc71194288636.png'. > > > proc.time() user system elapsed 1.546 0.301 1.613