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(59.9 + ,8.6 + ,13.5 + ,-12.7 + ,59.9 + ,8.6 + ,16.2 + ,-2.4 + ,59.9 + ,8.5 + ,17.6 + ,7.1 + ,60.9 + ,8.4 + ,15.8 + ,-3.9 + ,60.9 + ,8.3 + ,17.6 + ,9.5 + ,60.9 + ,8.3 + ,15.2 + ,5 + ,61.1 + ,8.2 + ,15.9 + ,-16.1 + ,61.1 + ,8.2 + ,12 + ,-10.8 + ,61.1 + ,8.1 + ,13.3 + ,7 + ,60.2 + ,8 + ,14.8 + ,13.6 + ,60.2 + ,8 + ,16.1 + ,8.1 + ,60.2 + ,7.9 + ,16.9 + ,-8.1 + ,60.1 + ,7.8 + ,17.6 + ,4.9 + ,60.1 + ,7.8 + ,13.9 + ,-0.8 + ,60.1 + ,7.8 + ,10 + ,4.3 + ,59.7 + ,7.8 + ,7.6 + ,4 + ,59.7 + ,7.8 + ,7.1 + ,1.5 + ,59.7 + ,7.8 + ,8.1 + ,5.4 + ,60.5 + ,7.8 + ,8.1 + ,-11.3 + ,60.5 + ,7.8 + ,7.7 + ,-16.4 + ,60.5 + ,7.8 + ,4 + ,-2 + ,59.5 + ,7.9 + ,1.4 + ,8.9 + ,59.5 + ,7.9 + ,0.3 + ,-7.2 + ,59.5 + ,7.9 + ,-1 + ,-18 + ,59.5 + ,8 + ,-1.9 + ,1.3 + ,59.5 + ,8 + ,-1.5 + ,6.3 + ,59.5 + ,8 + ,-0.2 + ,-6 + ,59.7 + ,8.1 + ,3.4 + ,2.8 + ,59.7 + ,8.1 + ,3 + ,2 +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+ ,8.8 + ,7.8 + ,5.3 + ,61.2 + ,8.8 + ,7.5 + ,3 + ,61.2 + ,8.8 + ,7.7 + ,17.1 + ,61.2 + ,8.8 + ,7.5 + ,26.3 + ,61.2 + ,8.7 + ,8.3 + ,38.1 + ,61.2 + ,8.6 + ,7.9 + ,19.5 + ,60.3 + ,8.7 + ,10.4 + ,38 + ,60.3 + ,8.6 + ,11.5 + ,35.5 + ,60.3 + ,8.6 + ,14 + ,78.6 + ,60.4 + ,8.4 + ,11.9 + ,62.2 + ,60.4 + ,8.4 + ,11.9 + ,76.9 + ,60.4 + ,8.3 + ,10.3 + ,104.9 + ,61.2 + ,8.1 + ,11.3 + ,32.2 + ,61.2 + ,8.1 + ,9.9 + ,42.5 + ,61.2 + ,8 + ,8.9 + ,64.3 + ,62.1 + ,8 + ,9.2 + ,74.9 + ,62.1 + ,7.9 + ,8.8 + ,75.4 + ,62.1 + ,7.8 + ,6.7 + ,43 + ,61.7 + ,7.7 + ,7.1 + ,58.7 + ,61.7 + ,7.6 + ,6.6 + ,55.4 + ,61.7 + ,7.6 + ,7.2 + ,76.6 + ,61.6 + ,7.5 + ,5 + ,63.3 + ,61.6 + ,7.5 + ,5.3 + ,78.9 + ,61.6 + ,7.4 + ,6.3 + ,82.7) + ,dim=c(4 + ,90) + ,dimnames=list(c('WG' + ,'WL' + ,'EA' + ,'TI') + ,1:90)) > y <- array(NA,dim=c(4,90),dimnames=list(c('WG','WL','EA','TI'),1:90)) > 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 90 members at h = 1098] |--[dendrogram w/ 2 branches and 13 members at h = 83.3] | |--[dendrogram w/ 2 branches and 5 members at h = 11.2] | | |--[dendrogram w/ 2 branches and 2 members at h = 3.34] | | | |--leaf "85" | | | `--leaf "86" | | `--[dendrogram w/ 2 branches and 3 members at h = 6.23] | | |--leaf "88" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.77] | | |--leaf "76" | | `--leaf "81" | `--[dendrogram w/ 2 branches and 8 members at h = 43.9] | |--leaf "78" | `--[dendrogram w/ 2 branches and 7 members at h = 12.2] | |--[dendrogram w/ 2 branches and 2 members at h = 3.93] | | |--leaf "89" | | `--leaf "90" | `--[dendrogram w/ 2 branches and 5 members at h = 10] | |--[dendrogram w/ 2 branches and 2 members at h = 2.71] | | |--leaf "75" | | `--leaf "77" | `--[dendrogram w/ 2 branches and 3 members at h = 2.95] | |--leaf "87" | `--[dendrogram w/ 2 branches and 2 members at h = 0.648] | |--leaf "82" | `--leaf "83" `--[dendrogram w/ 2 branches and 77 members at h = 578] |--[dendrogram w/ 2 branches and 25 members at h = 124] | |--[dendrogram w/ 2 branches and 11 members at h = 20.5] | | |--[dendrogram w/ 2 branches and 6 members at h = 6.48] | | | |--[dendrogram w/ 2 branches and 3 members at h = 3.15] | | | | |--leaf "34" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.49] | | | | |--leaf "51" | | | | `--leaf "65" | | | `--[dendrogram w/ 2 branches and 3 members at h = 3.96] | | | |--leaf "60" | | | `--[dendrogram w/ 2 branches and 2 members at h = 2.42] | | | |--leaf "69" | | | `--leaf "72" | | `--[dendrogram w/ 2 branches and 5 members at h = 8.62] | | |--leaf "10" | | `--[dendrogram w/ 2 branches and 4 members at h = 5.85] | | |--leaf "46" | | `--[dendrogram w/ 2 branches and 3 members at h = 3.45] | | |--leaf "61" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.38] | | |--leaf "52" | | `--leaf "62" | `--[dendrogram w/ 2 branches and 14 members at h = 39.1] | |--[dendrogram w/ 2 branches and 7 members at h = 6.79] | | |--[dendrogram w/ 2 branches and 3 members at h = 2.55] | | | |--leaf "70" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.28] | | | |--leaf "57" | | | `--leaf "59" | | `--[dendrogram w/ 2 branches and 4 members at h = 3.82] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.3] | | | |--leaf "54" | | | `--leaf "58" | | `--[dendrogram w/ 2 branches and 2 members at h = 2.58] | | |--leaf "64" | | `--leaf "66" | `--[dendrogram w/ 2 branches and 7 members at h = 14.6] | |--[dendrogram w/ 2 branches and 2 members at h = 3.37] | | |--leaf "80" | | `--leaf "84" | `--[dendrogram w/ 2 branches and 5 members at h = 6.72] | |--[dendrogram w/ 2 branches and 2 members at h = 2.29] | | |--leaf "71" | | `--leaf "73" | `--[dendrogram w/ 2 branches and 3 members at h = 5.84] | |--leaf "63" | `--[dendrogram w/ 2 branches and 2 members at h = 3.46] | |--leaf "74" | `--leaf "79" `--[dendrogram w/ 2 branches and 52 members at h = 178] |--[dendrogram w/ 2 branches and 20 members at h = 62.5] | |--[dendrogram w/ 2 branches and 9 members at h = 15.2] | | |--[dendrogram w/ 2 branches and 4 members at h = 4.85] | | | |--[dendrogram w/ 2 branches and 2 members at h = 1.30] | | | | |--leaf "23" | | | | `--leaf "27" | | | `--[dendrogram w/ 2 branches and 2 members at h = 2.14] | | | |--leaf "31" | | | `--leaf "43" | | `--[dendrogram w/ 2 branches and 5 members at h = 5.97] | | |--leaf "37" | | `--[dendrogram w/ 2 branches and 4 members at h = 3.42] | | |--leaf "41" | | `--[dendrogram w/ 2 branches and 3 members at h = 1.71] | | |--leaf "49" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.46] | | |--leaf "21" | | `--leaf "47" | `--[dendrogram w/ 2 branches and 11 members at h = 34.4] | |--[dendrogram w/ 2 branches and 3 members at h = 8.62] | | |--leaf "44" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.36] | | |--leaf "24" | | `--leaf "32" | `--[dendrogram w/ 2 branches and 8 members at h = 21] | |--[dendrogram w/ 2 branches and 4 members at h = 7.46] | | |--leaf "20" | | `--[dendrogram w/ 2 branches and 3 members at h = 3.76] | | |--leaf "19" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.84] | | |--leaf "36" | | `--leaf "48" | `--[dendrogram w/ 2 branches and 4 members at h = 7.5] | |--leaf "12" | `--[dendrogram w/ 2 branches and 3 members at h = 6.38] | |--leaf "7" | `--[dendrogram w/ 2 branches and 2 members at h = 2.73] | |--leaf "1" | `--leaf "8" `--[dendrogram w/ 2 branches and 32 members at h = 84.5] |--[dendrogram w/ 2 branches and 22 members at h = 25.4] | |--[dendrogram w/ 2 branches and 8 members at h = 6.84] | | |--leaf "53" | | `--[dendrogram w/ 2 branches and 7 members at h = 4.12] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.71] | | | |--leaf "55" | | | `--leaf "68" | | `--[dendrogram w/ 2 branches and 5 members at h = 3.48] | | |--[dendrogram w/ 2 branches and 2 members at h = 2.01] | | | |--leaf "33" | | | `--leaf "67" | | `--[dendrogram w/ 2 branches and 3 members at h = 2.63] | | |--leaf "15" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.49] | | |--leaf "16" | | `--leaf "18" | `--[dendrogram w/ 2 branches and 14 members at h = 19.7] | |--[dendrogram w/ 2 branches and 4 members at h = 9.74] | | |--[dendrogram w/ 2 branches and 2 members at h = 2.38] | | | |--leaf "22" | | | `--leaf "45" | | `--[dendrogram w/ 2 branches and 2 members at h = 5.02] | | |--leaf "25" | | `--leaf "26" | `--[dendrogram w/ 2 branches and 10 members at h = 12.2] | |--[dendrogram w/ 2 branches and 4 members at h = 2.23] | | |--leaf "17" | | `--[dendrogram w/ 2 branches and 3 members at h = 1.83] | | |--leaf "38" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.38] | | |--leaf "35" | | `--leaf "50" | `--[dendrogram w/ 2 branches and 6 members at h = 4.13] | |--[dendrogram w/ 2 branches and 2 members at h = 2.62] | | |--leaf "30" | | `--leaf "39" | `--[dendrogram w/ 2 branches and 4 members at h = 3.39] | |--leaf "42" | `--[dendrogram w/ 2 branches and 3 members at h = 1.41] | |--leaf "40" | `--[dendrogram w/ 2 branches and 2 members at h = 0.894] | |--leaf "28" | `--leaf "29" `--[dendrogram w/ 2 branches and 10 members at h = 35.3] |--[dendrogram w/ 2 branches and 4 members at h = 5.08] | |--leaf "56" | `--[dendrogram w/ 2 branches and 3 members at h = 3.84] | |--leaf "14" | `--[dendrogram w/ 2 branches and 2 members at h = 1.86] | |--leaf "2" | `--leaf "4" `--[dendrogram w/ 2 branches and 6 members at h = 6] |--[dendrogram w/ 2 branches and 3 members at h = 2.57] | |--leaf "5" | `--[dendrogram w/ 2 branches and 2 members at h = 1.89] | |--leaf "3" | `--leaf "11" `--[dendrogram w/ 2 branches and 3 members at h = 4.25] |--leaf "9" `--[dendrogram w/ 2 branches and 2 members at h = 2.58] |--leaf "6" `--leaf "13" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/17mfj1199648635.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/2vibm1199648635.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/371ei1199648635.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/4zxxc1199648635.tab") + } > > system("convert tmp/17mfj1199648635.ps tmp/17mfj1199648635.png") > system("convert tmp/2vibm1199648635.ps tmp/2vibm1199648635.png") convert: unable to open image `tmp/2vibm1199648635.ps': No such file or directory. convert: missing an image filename `tmp/2vibm1199648635.png'. > > > proc.time() user system elapsed 0.958 0.209 1.070