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(70.9 + ,58.4 + ,73 + ,56.8 + ,83.9 + ,69.4 + ,73.2 + ,59.6 + ,76.7 + ,63.6 + ,83.1 + ,68.4 + ,59.8 + ,55.9 + ,68.2 + ,59.1 + ,91.1 + ,66.2 + ,85 + ,66.5 + ,81.6 + ,64.5 + ,78.8 + ,74.5 + ,73 + ,60 + ,74.3 + ,61.4 + ,81.2 + ,70.1 + ,79.9 + ,65.7 + ,79.7 + ,67.1 + ,83.6 + ,70.8 + ,68.6 + ,61.5 + ,666 + ,60.1 + ,83.5 + ,70.1 + ,91.8 + ,73.2 + ,80.5 + ,67.1 + ,84.7 + ,77.4 + ,78.7 + ,66.9 + ,78.4 + ,66 + ,83.1 + ,74 + ,84.8 + ,75.8 + ,80.7 + ,72.2 + ,91.8 + ,78.2 + ,75.3 + ,71.4 + ,71.8 + ,66.3 + ,93 + ,79.9 + ,94.3 + ,81.2 + ,83.7 + ,72.2 + ,95.6 + ,88.4 + ,82.2 + ,72.2 + ,83.4 + ,73 + ,93.1 + ,83.8 + ,88.7 + ,79.7 + ,84.5 + ,79.1 + ,95 + ,84.3 + ,76.6 + ,76.8 + ,73.4 + ,69.3 + ,93 + ,81.3 + ,91 + ,80.9 + ,85.3 + ,76 + ,89.5 + ,90 + ,76.1 + ,72.6 + ,76.1 + ,73.9 + ,91.5 + ,91.2 + ,85.4 + ,83.1 + ,80 + ,80.1 + ,94 + ,91.1 + ,72.6 + ,80.1 + ,80.8 + ,76.3 + ,94.1 + ,93.2 + ,94.9 + ,91.6 + ,91.9 + ,88.5 + ,99.2 + ,103.2 + ,84.7 + ,84.9 + ,93.7 + ,89 + ,106.7 + ,106.9 + ,93.5 + ,91.4 + ,104.8 + ,99.6 + ,103.5 + ,100.6 + ,83.1 + ,88 + ,89.6 + ,89.7 + ,105.7 + ,106.7 + ,110.7 + ,106 + ,110.4 + ,104.4 + ,109 + ,123.7 + ,106 + ,97.1 + ,100.9 + ,95.5 + ,114.3 + ,112.2 + ,101.2 + ,101.4 + ,109.2 + ,106.9 + ,111.6 + ,109.5 + ,91.7 + ,96.4 + ,93.7 + ,93.9 + ,105.7 + ,104.2 + ,109.5 + ,109.2 + ,105.3 + ,108.9 + ,102.8 + ,117.9 + ,100.6 + ,98.2 + ,97.6 + ,101.4 + ,110.3 + ,111.6 + ,107.2 + ,113.6 + ,107.2 + ,110.8 + ,108.1 + ,113.9 + ,97.1 + ,105.5 + ,92.2 + ,95.9 + ,112.2 + ,115.8 + ,111.6 + ,119.9 + ,115.7 + ,107.3 + ,111.3 + ,126.9 + ,104.2 + ,107.8 + ,103.2 + ,105.5 + ,112.7 + ,120.2 + ,106.4 + ,116 + ,102.6 + ,110.4 + ,110.6 + ,120.8 + ,95.2 + ,110.7 + ,89 + ,99.9 + ,112.5 + ,126.8 + ,116.8 + ,128.6 + ,107.2 + ,112.9 + ,113.6 + ,136.6 + ,101.8 + ,113.3 + ,102.6 + ,116.3 + ,122.7 + ,137.5 + ,110.3 + ,126.7 + ,110.5 + ,118.5 + ,121.6 + ,136.4 + ,100.3 + ,120.2 + ,100.7 + ,117.2 + ,123.4 + ,133.3 + ,127.1 + ,134.8 + ,124.1 + ,129.9 + ,131.2 + ,149.5 + ,111.6 + ,118.5 + ,114.2 + ,122.8 + ,130.1 + ,145.7 + ,125.9 + ,133.6 + ,119 + ,130.8 + ,133.8 + ,146.8 + ,107.5 + ,126 + ,113.5 + ,124.4 + ,134.4 + ,145.5 + ,126.8 + ,146.3 + ,135.6 + ,145 + ,139.9 + ,162 + ,129.8 + ,132.2 + ,131 + ,140.2 + ,153.1 + ,164.8 + ,134.1 + ,143.7 + ,144.1 + ,144.2) + ,dim=c(2 + ,137) + ,dimnames=list(c('Totaal' + ,'Niet-Industrieel') + ,1:137)) > y <- array(NA,dim=c(2,137),dimnames=list(c('Totaal','Niet-Industrieel'),1:137)) > 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 137 members at h = 2183] |--[dendrogram w/ 2 branches and 53 members at h = 194] | |--[dendrogram w/ 2 branches and 20 members at h = 64.9] | | |--[dendrogram w/ 2 branches and 8 members at h = 8.92] | | | |--[dendrogram w/ 2 branches and 3 members at h = 3.31] | | | | |--leaf "30" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 2.59] | | | | |--leaf "40" | | | | `--leaf "46" | | | `--[dendrogram w/ 2 branches and 5 members at h = 5.96] | | | |--[dendrogram w/ 2 branches and 3 members at h = 1.72] | | | | |--leaf "33" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.30] | | | | |--leaf "34" | | | | `--leaf "45" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.96] | | | |--leaf "39" | | | `--leaf "42" | | `--[dendrogram w/ 2 branches and 12 members at h = 26.2] | | |--[dendrogram w/ 2 branches and 3 members at h = 5.29] | | | |--leaf "67" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.93] | | | |--leaf "52" | | | `--leaf "61" | | `--[dendrogram w/ 2 branches and 9 members at h = 20.6] | | |--[dendrogram w/ 2 branches and 4 members at h = 3.70] | | | |--[dendrogram w/ 2 branches and 2 members at h = 0.539] | | | | |--leaf "28" | | | | `--leaf "47" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.71] | | | |--leaf "24" | | | `--leaf "41" | | `--[dendrogram w/ 2 branches and 5 members at h = 9.55] | | |--leaf "55" | | `--[dendrogram w/ 2 branches and 4 members at h = 5.49] | | |--leaf "53" | | `--[dendrogram w/ 2 branches and 3 members at h = 4.04] | | |--leaf "43" | | `--[dendrogram w/ 2 branches and 2 members at h = 2.69] | | |--leaf "12" | | `--leaf "56" | `--[dendrogram w/ 2 branches and 33 members at h = 116] | |--[dendrogram w/ 2 branches and 8 members at h = 18.9] | | |--leaf "7" | | `--[dendrogram w/ 2 branches and 7 members at h = 9.43] | | |--[dendrogram w/ 2 branches and 2 members at h = 2.43] | | | |--leaf "8" | | | `--leaf "19" | | `--[dendrogram w/ 2 branches and 5 members at h = 5.45] | | |--[dendrogram w/ 2 branches and 3 members at h = 2.53] | | | |--leaf "14" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.447] | | | |--leaf "4" | | | `--leaf "13" | | `--[dendrogram w/ 2 branches and 2 members at h = 2.64] | | |--leaf "1" | | `--leaf "2" | `--[dendrogram w/ 2 branches and 25 members at h = 46.6] | |--[dendrogram w/ 2 branches and 14 members at h = 20.9] | | |--[dendrogram w/ 2 branches and 2 members at h = 7.03] | | | |--leaf "9" | | | `--leaf "22" | | `--[dendrogram w/ 2 branches and 12 members at h = 13.5] | | |--[dendrogram w/ 2 branches and 6 members at h = 5.08] | | | |--[dendrogram w/ 2 branches and 3 members at h = 1.68] | | | | |--leaf "27" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.854] | | | | |--leaf "35" | | | | `--leaf "38" | | | `--[dendrogram w/ 2 branches and 3 members at h = 2.49] | | | |--leaf "15" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.5] | | | |--leaf "29" | | | `--leaf "37" | | `--[dendrogram w/ 2 branches and 6 members at h = 8.07] | | |--[dendrogram w/ 2 branches and 4 members at h = 2.25] | | | |--leaf "6" | | | `--[dendrogram w/ 2 branches and 3 members at h = 1.26] | | | |--leaf "3" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.707] | | | |--leaf "18" | | | `--leaf "21" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.94] | | |--leaf "10" | | `--leaf "11" | `--[dendrogram w/ 2 branches and 11 members at h = 24.8] | |--[dendrogram w/ 2 branches and 6 members at h = 5.81] | | |--leaf "5" | | `--[dendrogram w/ 2 branches and 5 members at h = 2.49] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.949] | | | |--leaf "25" | | | `--leaf "26" | | `--[dendrogram w/ 2 branches and 3 members at h = 1.69] | | |--leaf "16" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.8] | | |--leaf "17" | | `--leaf "23" | `--[dendrogram w/ 2 branches and 5 members at h = 10.5] | |--[dendrogram w/ 2 branches and 3 members at h = 2.28] | | |--leaf "31" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.3] | | |--leaf "49" | | `--leaf "50" | `--[dendrogram w/ 2 branches and 2 members at h = 3.4] | |--leaf "32" | `--leaf "44" `--[dendrogram w/ 2 branches and 84 members at h = 1079] |--leaf "20" `--[dendrogram w/ 2 branches and 83 members at h = 861] |--[dendrogram w/ 2 branches and 33 members at h = 267] | |--[dendrogram w/ 2 branches and 11 members at h = 55.5] | | |--[dendrogram w/ 2 branches and 2 members at h = 13.5] | | | |--leaf "132" | | | `--leaf "135" | | `--[dendrogram w/ 2 branches and 9 members at h = 17.8] | | |--leaf "137" | | `--[dendrogram w/ 2 branches and 8 members at h = 12.5] | | |--[dendrogram w/ 2 branches and 3 members at h = 5.15] | | | |--leaf "120" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.35] | | | |--leaf "123" | | | `--leaf "130" | | `--[dendrogram w/ 2 branches and 5 members at h = 8.7] | | |--leaf "134" | | `--[dendrogram w/ 2 branches and 4 members at h = 2.69] | | |--leaf "126" | | `--[dendrogram w/ 2 branches and 3 members at h = 2.11] | | |--leaf "136" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.3] | | |--leaf "129" | | `--leaf "131" | `--[dendrogram w/ 2 branches and 22 members at h = 114] | |--[dendrogram w/ 2 branches and 12 members at h = 22.7] | | |--[dendrogram w/ 2 branches and 5 members at h = 3.21] | | | |--[dendrogram w/ 2 branches and 2 members at h = 1.1] | | | | |--leaf "113" | | | | `--leaf "121" | | | `--[dendrogram w/ 2 branches and 3 members at h = 1.97] | | | |--leaf "102" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.14] | | | |--leaf "94" | | | `--leaf "99" | | `--[dendrogram w/ 2 branches and 7 members at h = 9] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.75] | | | |--leaf "122" | | | `--leaf "128" | | `--[dendrogram w/ 2 branches and 5 members at h = 6.67] | | |--[dendrogram w/ 2 branches and 3 members at h = 1.93] | | | |--leaf "105" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.02] | | | |--leaf "96" | | | `--leaf "112" | | `--[dendrogram w/ 2 branches and 2 members at h = 2.75] | | |--leaf "72" | | `--leaf "127" | `--[dendrogram w/ 2 branches and 10 members at h = 22.9] | |--[dendrogram w/ 2 branches and 3 members at h = 10] | | |--leaf "108" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.11] | | |--leaf "106" | | `--leaf "125" | `--[dendrogram w/ 2 branches and 7 members at h = 11.7] | |--[dendrogram w/ 2 branches and 2 members at h = 1.56] | | |--leaf "111" | | `--leaf "114" | `--[dendrogram w/ 2 branches and 5 members at h = 6.96] | |--[dendrogram w/ 2 branches and 2 members at h = 3.47] | | |--leaf "117" | | `--leaf "119" | `--[dendrogram w/ 2 branches and 3 members at h = 4.7] | |--leaf "133" | `--[dendrogram w/ 2 branches and 2 members at h = 1.70] | |--leaf "118" | `--leaf "124" `--[dendrogram w/ 2 branches and 50 members at h = 293] |--[dendrogram w/ 2 branches and 27 members at h = 55.1] | |--[dendrogram w/ 2 branches and 7 members at h = 15] | | |--[dendrogram w/ 2 branches and 4 members at h = 4.49] | | | |--leaf "115" | | | `--[dendrogram w/ 2 branches and 3 members at h = 2.34] | | | |--leaf "116" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.61] | | | |--leaf "84" | | | `--leaf "110" | | `--[dendrogram w/ 2 branches and 3 members at h = 8.66] | | |--leaf "103" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.01] | | |--leaf "101" | | `--leaf "109" | `--[dendrogram w/ 2 branches and 20 members at h = 30.4] | |--[dendrogram w/ 2 branches and 6 members at h = 5.17] | | |--[dendrogram w/ 2 branches and 2 members at h = 2.82] | | | |--leaf "81" | | | `--leaf "98" | | `--[dendrogram w/ 2 branches and 4 members at h = 3.31] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.02] | | | |--leaf "63" | | | `--leaf "69" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.56] | | |--leaf "83" | | `--leaf "97" | `--[dendrogram w/ 2 branches and 14 members at h = 23.3] | |--[dendrogram w/ 2 branches and 5 members at h = 4.37] | | |--leaf "100" | | `--[dendrogram w/ 2 branches and 4 members at h = 3.56] | | |--leaf "89" | | `--[dendrogram w/ 2 branches and 3 members at h = 1.30] | | |--leaf "90" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.7] | | |--leaf "88" | | `--leaf "107" | `--[dendrogram w/ 2 branches and 9 members at h = 13.9] | |--[dendrogram w/ 2 branches and 3 members at h = 2.47] | | |--leaf "77" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.63] | | |--leaf "70" | | `--leaf "71" | `--[dendrogram w/ 2 branches and 6 members at h = 8.32] | |--[dendrogram w/ 2 branches and 2 members at h = 4.17] | | |--leaf "75" | | `--leaf "93" | `--[dendrogram w/ 2 branches and 4 members at h = 7.83] | |--leaf "95" | `--[dendrogram w/ 2 branches and 3 members at h = 2.63] | |--leaf "87" | `--[dendrogram w/ 2 branches and 2 members at h = 2.12] | |--leaf "78" | `--leaf "82" `--[dendrogram w/ 2 branches and 23 members at h = 88.7] |--[dendrogram w/ 2 branches and 9 members at h = 17.3] | |--[dendrogram w/ 2 branches and 4 members at h = 5.07] | | |--leaf "91" | | `--[dendrogram w/ 2 branches and 3 members at h = 3.39] | | |--leaf "76" | | `--[dendrogram w/ 2 branches and 2 members at h = 2.41] | | |--leaf "60" | | `--leaf "86" | `--[dendrogram w/ 2 branches and 5 members at h = 8.22] | |--[dendrogram w/ 2 branches and 2 members at h = 2.72] | | |--leaf "74" | | `--leaf "85" | `--[dendrogram w/ 2 branches and 3 members at h = 4.17] | |--leaf "73" | `--[dendrogram w/ 2 branches and 2 members at h = 1.64] | |--leaf "65" | `--leaf "66" `--[dendrogram w/ 2 branches and 14 members at h = 21.5] |--[dendrogram w/ 2 branches and 3 members at h = 6.13] | |--leaf "104" | `--[dendrogram w/ 2 branches and 2 members at h = 0.707] | |--leaf "79" | `--leaf "92" `--[dendrogram w/ 2 branches and 11 members at h = 11.5] |--[dendrogram w/ 2 branches and 5 members at h = 4.19] | |--[dendrogram w/ 2 branches and 2 members at h = 0.806] | | |--leaf "57" | | `--leaf "80" | `--[dendrogram w/ 2 branches and 3 members at h = 1.43] | |--leaf "58" | `--[dendrogram w/ 2 branches and 2 members at h = 0.583] | |--leaf "54" | `--leaf "64" `--[dendrogram w/ 2 branches and 6 members at h = 8.17] |--[dendrogram w/ 2 branches and 3 members at h = 3.06] | |--leaf "51" | `--[dendrogram w/ 2 branches and 2 members at h = 0.316] | |--leaf "48" | `--leaf "68" `--[dendrogram w/ 2 branches and 3 members at h = 3.17] |--leaf "36" `--[dendrogram w/ 2 branches and 2 members at h = 1.87] |--leaf "59" `--leaf "62" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1bjfz1194259194.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/25bml1194259194.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/3nmar1194259195.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/4c8o81194259196.tab") + } > > system("convert tmp/1bjfz1194259194.ps tmp/1bjfz1194259194.png") > system("convert tmp/25bml1194259194.ps tmp/25bml1194259194.png") convert: unable to open image `tmp/25bml1194259194.ps': No such file or directory. convert: missing an image filename `tmp/25bml1194259194.png'. > > > proc.time() user system elapsed 1.275 0.263 1.394