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.7 + ,97.3 + ,93.5 + ,104.8 + ,124.9 + ,110.2 + ,101 + ,94.7 + ,105.6 + ,132 + ,125.9 + ,113.2 + ,112.9 + ,118.3 + ,151.4 + ,100.1 + ,101 + ,99.2 + ,89.9 + ,108.9 + ,106.4 + ,105.7 + ,105.6 + ,90.2 + ,121.3 + ,114.8 + ,113.9 + ,113 + ,107 + ,123.4 + ,81.3 + ,86.4 + ,83.1 + ,64.5 + ,90.3 + ,87 + ,96.5 + ,81.1 + ,92.6 + ,79.3 + ,104.2 + ,103.3 + ,96.9 + ,95.8 + ,117.2 + ,108 + ,114.9 + ,104.3 + ,94.3 + ,116.9 + ,105 + ,105.8 + ,97.7 + ,91.2 + ,120.8 + ,94.5 + ,94.2 + ,102.6 + ,86.3 + ,96.1 + ,92 + ,98.4 + ,89.9 + ,77.6 + ,100.8 + ,95.9 + ,99.4 + ,96 + ,82.5 + ,105.3 + ,108.8 + ,108.8 + ,112.7 + ,97.7 + ,116.1 + ,103.4 + ,112.6 + ,107.1 + ,83.3 + ,112.8 + ,102.1 + ,104.4 + ,106.2 + ,84.2 + ,114.5 + ,110.1 + ,112.2 + ,121 + ,92.8 + ,117.2 + ,83.2 + ,81.1 + ,101.2 + ,77.4 + ,77.1 + ,82.7 + ,97.1 + ,83.2 + ,72.5 + ,80.1 + ,106.8 + ,112.6 + ,105.1 + ,88.8 + ,120.3 + ,113.7 + ,113.8 + ,113.3 + ,93.4 + ,133.4 + ,102.5 + ,107.8 + ,99.1 + ,92.6 + ,109.4 + ,96.6 + ,103.2 + ,100.3 + ,90.7 + ,93.2 + ,92.1 + ,103.3 + ,93.5 + ,81.6 + ,91.2 + ,95.6 + ,101.2 + ,98.8 + ,84.1 + ,99.2 + ,102.3 + ,107.7 + ,106.2 + ,88.1 + ,108.2 + ,98.6 + ,110.4 + ,98.3 + ,85.3 + ,101.5 + ,98.2 + ,101.9 + ,102.1 + ,82.9 + ,106.9 + ,104.5 + ,115.9 + ,117.1 + ,84.8 + ,104.4 + ,84 + ,89.9 + ,101.5 + ,71.2 + ,77.9 + ,73.8 + ,88.6 + ,80.5 + ,68.9 + ,60 + ,103.9 + ,117.2 + ,105.9 + ,94.3 + ,99.5 + ,106 + ,123.9 + ,109.5 + ,97.6 + ,95 + ,97.2 + ,100 + ,97.2 + ,85.6 + ,105.6 + ,102.6 + ,103.6 + ,114.5 + ,91.9 + ,102.5 + ,89 + ,94.1 + ,93.5 + ,75.8 + ,93.3 + ,93.8 + ,98.7 + ,100.9 + ,79.8 + ,97.3 + ,116.7 + ,119.5 + ,121.1 + ,99 + ,127 + ,106.8 + ,112.7 + ,116.5 + ,88.5 + ,111.7 + ,98.5 + ,104.4 + ,109.3 + ,86.7 + ,96.4 + ,118.7 + ,124.7 + ,118.1 + ,97.9 + ,133 + ,90 + ,89.1 + ,108.3 + ,94.3 + ,72.2 + ,91.9 + ,97 + ,105.4 + ,72.9 + ,95.8 + ,113.3 + ,121.6 + ,116.2 + ,91.8 + ,124.1 + ,113.1 + ,118.8 + ,111.2 + ,93.2 + ,127.6 + ,104.1 + ,114 + ,105.8 + ,86.5 + ,110.7 + ,108.7 + ,111.5 + ,122.7 + ,98.9 + ,104.6 + ,96.7 + ,97.2 + ,99.5 + ,77.2 + ,112.7 + ,101 + ,102.5 + ,107.9 + ,79.4 + ,115.3 + ,116.9 + ,113.4 + ,124.6 + ,90.4 + ,139.4 + ,105.8 + ,109.8 + ,115 + ,81.4 + ,119 + ,99 + ,104.9 + ,110.3 + ,85.8 + ,97.4 + ,129.4 + ,126.1 + ,132.7 + ,103.6 + ,154 + ,83 + ,80 + ,99.7 + ,73.6 + ,81.5 + ,88.9 + ,96.8 + ,96.5 + ,75.7 + ,88.8 + ,115.9 + ,117.2 + ,118.7 + ,99.2 + ,127.7 + ,104.2 + ,112.3 + ,112.9 + ,88.7 + ,105.1 + ,113.4 + ,117.3 + ,130.5 + ,94.6 + ,114.9 + ,112.2 + ,111.1 + ,137.9 + ,98.7 + ,106.4 + ,100.8 + ,102.2 + ,115 + ,84.2 + ,104.5 + ,107.3 + ,104.3 + ,116.8 + ,87.7 + ,121.6 + ,126.6 + ,122.9 + ,140.9 + ,103.3 + ,141.4 + ,102.9 + ,107.6 + ,120.7 + ,88.2 + ,99 + ,117.9 + ,121.3 + ,134.2 + ,93.4 + ,126.7 + ,128.8 + ,131.5 + ,147.3 + ,106.3 + ,134.1 + ,87.5 + ,89 + ,112.4 + ,73.1 + ,81.3 + ,93.8 + ,104.4 + ,107.1 + ,78.6 + ,88.6 + ,122.7 + ,128.9 + ,128.4 + ,101.6 + ,132.7 + ,126.2 + ,135.9 + ,137.7 + ,101.4 + ,132.9 + ,124.6 + ,133.3 + ,135 + ,98.5 + ,134.4 + ,116.7 + ,121.3 + ,151 + ,99 + ,103.7 + ,115.2 + ,120.5 + ,137.4 + ,89.5 + ,119.7 + ,111.1 + ,120.4 + ,132.4 + ,83.5 + ,115 + ,129.9 + ,137.9 + ,161.3 + ,97.4 + ,132.9 + ,113.3 + ,126.1 + ,139.8 + ,87.8 + ,108.5 + ,118.5 + ,133.2 + ,146 + ,90.4 + ,113.9 + ,133.5 + ,146.6 + ,154.6 + ,97.1 + ,142.9 + ,102.1 + ,103.4 + ,142.1 + ,79.4 + ,95.2 + ,102.4 + ,117.2 + ,120.5 + ,85 + ,93) + ,dim=c(5 + ,80) + ,dimnames=list(c('Totaal' + ,'ProductenMet' + ,'MachAppWerkt' + ,'AppInstr' + ,'Metverw') + ,1:80)) > y <- array(NA,dim=c(5,80),dimnames=list(c('Totaal','ProductenMet','MachAppWerkt','AppInstr','Metverw'),1:80)) > 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 = 'single' > 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 80 members at h = 28.2] |--leaf "3" `--[dendrogram w/ 2 branches and 79 members at h = 24] |--leaf "32" `--[dendrogram w/ 2 branches and 78 members at h = 23.8] |--leaf "79" `--[dendrogram w/ 2 branches and 77 members at h = 21.7] |--leaf "43" `--[dendrogram w/ 2 branches and 76 members at h = 20.7] |--leaf "8" `--[dendrogram w/ 2 branches and 75 members at h = 17.9] |--[dendrogram w/ 2 branches and 2 members at h = 15.3] | |--leaf "75" | `--leaf "78" `--[dendrogram w/ 2 branches and 73 members at h = 17.4] |--leaf "72" `--[dendrogram w/ 2 branches and 72 members at h = 17.4] |--[dendrogram w/ 2 branches and 70 members at h = 15.6] | |--leaf "54" | `--[dendrogram w/ 2 branches and 69 members at h = 15.4] | |--[dendrogram w/ 2 branches and 4 members at h = 12.1] | | |--leaf "67" | | `--[dendrogram w/ 2 branches and 3 members at h = 10.8] | | |--leaf "31" | | `--[dendrogram w/ 2 branches and 2 members at h = 6.11] | | |--leaf "19" | | `--leaf "55" | `--[dendrogram w/ 2 branches and 65 members at h = 14.1] | |--leaf "48" | `--[dendrogram w/ 2 branches and 64 members at h = 13.9] | |--[dendrogram w/ 2 branches and 2 members at h = 8.86] | | |--leaf "1" | | `--leaf "2" | `--[dendrogram w/ 2 branches and 62 members at h = 13.6] | |--leaf "60" | `--[dendrogram w/ 2 branches and 61 members at h = 13.5] | |--leaf "51" | `--[dendrogram w/ 2 branches and 60 members at h = 13.5] | |--leaf "63" | `--[dendrogram w/ 2 branches and 59 members at h = 13.0] | |--[dendrogram w/ 2 branches and 48 members at h = 12.4] | | |--[dendrogram w/ 2 branches and 46 members at h = 12.1] | | | |--leaf "68" | | | `--[dendrogram w/ 2 branches and 45 members at h = 11.8] | | | |--leaf "80" | | | `--[dendrogram w/ 2 branches and 44 members at h = 11.7] | | | |--[dendrogram w/ 2 branches and 2 members at h = 9.66] | | | | |--leaf "33" | | | | `--leaf "34" | | | `--[dendrogram w/ 2 branches and 42 members at h = 11.6] | | | |--[dendrogram w/ 2 branches and 4 members at h = 10.5] | | | | |--leaf "59" | | | | `--[dendrogram w/ 2 branches and 3 members at h = 10] | | | | |--leaf "74" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 9.08] | | | | |--leaf "65" | | | | `--leaf "73" | | | `--[dendrogram w/ 2 branches and 38 members at h = 10.7] | | | |--[dendrogram w/ 2 branches and 2 members at h = 9.07] | | | | |--leaf "52" | | | | `--leaf "62" | | | `--[dendrogram w/ 2 branches and 36 members at h = 10.4] | | | |--leaf "15" | | | `--[dendrogram w/ 2 branches and 35 members at h = 10.1] | | | |--leaf "25" | | | `--[dendrogram w/ 2 branches and 34 members at h = 10.0] | | | |--leaf "28" | | | `--[dendrogram w/ 2 branches and 33 members at h = 10] | | | |--[dendrogram w/ 2 branches and 2 members at h = 6.05] | | | | |--leaf "37" | | | | `--leaf "56" | | | `--[dendrogram w/ 2 branches and 31 members at h = 9.95] | | | |--[dendrogram w/ 2 branches and 5 members at h = 8.1] | | | | |--[dendrogram w/ 2 branches and 2 members at h = 6.45] | | | | | |--leaf "9" | | | | | `--leaf "11" | | | | `--[dendrogram w/ 2 branches and 3 members at h = 7.14] | | | | |--leaf "5" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 7.01] | | | | |--leaf "10" | | | | `--leaf "21" | | | `--[dendrogram w/ 2 branches and 26 members at h = 9.89] | | | |--[dendrogram w/ 2 branches and 5 members at h = 9.25] | | | | |--[dendrogram w/ 2 branches and 2 members at h = 1.82] | | | | | |--leaf "41" | | | | | `--leaf "53" | | | | `--[dendrogram w/ 2 branches and 3 members at h = 8.97] | | | | |--leaf "64" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 8.29] | | | | |--leaf "36" | | | | `--leaf "61" | | | `--[dendrogram w/ 2 branches and 21 members at h = 9.88] | | | |--leaf "13" | | | `--[dendrogram w/ 2 branches and 20 members at h = 9.86] | | | |--leaf "49" | | | `--[dendrogram w/ 2 branches and 19 members at h = 9.32] | | | |--leaf "24" | | | `--[dendrogram w/ 2 branches and 18 members at h = 8.95] | | | |--leaf "18" | | | `--[dendrogram w/ 2 branches and 17 members at h = 8.92] | | | |--[dendrogram w/ 2 branches and 3 members at h = 7.97] | | | | |--leaf "40" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 6.81] | | | | |--leaf "30" | | | | `--leaf "58" | | | `--[dendrogram w/ 2 branches and 14 members at h = 8.75] | | | |--leaf "44" | | | `--[dendrogram w/ 2 branches and 13 members at h = 8.5] | | | |--[dendrogram w/ 2 branches and 5 members at h = 8.11] | | | | |--[dendrogram w/ 2 branches and 2 members at h = 5.6] | | | | | |--leaf "17" | | | | | `--leaf "50" | | | | `--[dendrogram w/ 2 branches and 3 members at h = 7.2] | | | | |--leaf "27" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 4.33] | | | | |--leaf "16" | | | | `--leaf "47" | | | `--[dendrogram w/ 2 branches and 8 members at h = 8.2] | | | |--leaf "12" | | | `--[dendrogram w/ 2 branches and 7 members at h = 7.72] | | | |--leaf "23" | | | `--[dendrogram w/ 2 branches and 6 members at h = 7.05] | | | |--[dendrogram w/ 2 branches and 2 members at h = 6] | | | | |--leaf "26" | | | | `--leaf "38" | | | `--[dendrogram w/ 2 branches and 4 members at h = 6.54] | | | |--leaf "4" | | | `--[dendrogram w/ 2 branches and 3 members at h = 6.13] | | | |--leaf "29" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.63] | | | |--leaf "14" | | | `--leaf "35" | | `--[dendrogram w/ 2 branches and 2 members at h = 12.3] | | |--leaf "76" | | `--leaf "77" | `--[dendrogram w/ 2 branches and 11 members at h = 12.4] | |--[dendrogram w/ 2 branches and 7 members at h = 11.1] | | |--leaf "6" | | `--[dendrogram w/ 2 branches and 6 members at h = 10] | | |--[dendrogram w/ 2 branches and 3 members at h = 7.97] | | | |--leaf "22" | | | `--[dendrogram w/ 2 branches and 2 members at h = 6.86] | | | |--leaf "45" | | | `--leaf "46" | | `--[dendrogram w/ 2 branches and 3 members at h = 8.79] | | |--leaf "42" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.50] | | |--leaf "39" | | `--leaf "57" | `--[dendrogram w/ 2 branches and 4 members at h = 12] | |--leaf "66" | `--[dendrogram w/ 2 branches and 3 members at h = 8.89] | |--leaf "69" | `--[dendrogram w/ 2 branches and 2 members at h = 5.22] | |--leaf "70" | `--leaf "71" `--[dendrogram w/ 2 branches and 2 members at h = 16.9] |--leaf "7" `--leaf "20" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/15s5h1194169866.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/2bh181194169866.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/348oh1194169867.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/4836v1194169867.tab") + } > > system("convert tmp/15s5h1194169866.ps tmp/15s5h1194169866.png") > system("convert tmp/2bh181194169866.ps tmp/2bh181194169866.png") convert: unable to open image `tmp/2bh181194169866.ps': No such file or directory. convert: missing an image filename `tmp/2bh181194169866.png'. > > > proc.time() user system elapsed 0.970 0.210 1.097