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(103.1 + ,98.6 + ,98.1 + ,98.6 + ,100.6 + ,98 + ,101.1 + ,98 + ,103.1 + ,106.8 + ,111.1 + ,106.8 + ,95.5 + ,96.6 + ,93.3 + ,96.7 + ,90.5 + ,100.1 + ,100 + ,100.2 + ,90.9 + ,107.7 + ,108 + ,107.7 + ,88.8 + ,91.5 + ,70.4 + ,92 + ,90.7 + ,97.8 + ,75.4 + ,98.4 + ,94.3 + ,107.4 + ,105.5 + ,107.4 + ,104.6 + ,117.5 + ,112.3 + ,117.7 + ,111.1 + ,105.6 + ,102.5 + ,105.7 + ,110.8 + ,97.4 + ,93.5 + ,97.5 + ,107.2 + ,99.5 + ,86.7 + ,99.9 + ,99 + ,98 + ,95.2 + ,98.2 + ,99 + ,104.3 + ,103.8 + ,104.5 + ,91 + ,100.6 + ,97 + ,100.8 + ,96.2 + ,101.1 + ,95.5 + ,101.5 + ,96.9 + ,103.9 + ,101 + ,103.9 + ,96.2 + ,96.9 + ,67.5 + ,99.6 + ,100.1 + ,95.5 + ,64 + ,98.4 + ,99 + ,108.4 + ,106.7 + ,112.7 + ,115.4 + ,117 + ,100.6 + ,118.4 + ,106.9 + ,103.8 + ,101.2 + ,108.1 + ,107.1 + ,100.8 + ,93.1 + ,105.4 + ,99.3 + ,110.6 + ,84.2 + ,114.6 + ,99.2 + ,104 + ,85.8 + ,106.9 + ,108.3 + ,112.6 + ,91.8 + ,115.9 + ,105.6 + ,107.3 + ,92.4 + ,109.8 + ,99.5 + ,98.9 + ,80.3 + ,101.8 + ,107.4 + ,109.8 + ,79.7 + ,114.2 + ,93.1 + ,104.9 + ,62.5 + ,110.8 + ,88.1 + ,102.2 + ,57.1 + ,108.4 + ,110.7 + ,123.9 + ,100.8 + ,127.5 + ,113.1 + ,124.9 + ,100.7 + ,128.6 + ,99.6 + ,112.7 + ,86.2 + ,116.6 + ,93.6 + ,121.9 + ,83.2 + ,127.4 + ,98.6 + ,100.6 + ,71.7 + ,105 + ,99.6 + ,104.3 + ,77.5 + ,108.3 + ,114.3 + ,120.4 + ,89.8 + ,125 + ,107.8 + ,107.5 + ,80.3 + ,111.6 + ,101.2 + ,102.9 + ,78.7 + ,106.5 + ,112.5 + ,125.6 + ,93.8 + ,130.3 + ,100.5 + ,107.5 + ,57.6 + ,115 + ,93.9 + ,108.8 + ,60.6 + ,116.1 + ,116.2 + ,128.4 + ,91 + ,134 + ,112 + ,121.1 + ,85.3 + ,126.5 + ,106.4 + ,119.5 + ,77.4 + ,125.8 + ,95.7 + ,128.7 + ,77.3 + ,136.4 + ,96 + ,108.7 + ,68.3 + ,114.9 + ,95.8 + ,105.5 + ,69.9 + ,110.9 + ,103 + ,119.8 + ,81.7 + ,125.5 + ,102.2 + ,111.3 + ,75.1 + ,116.8 + ,98.4 + ,110.6 + ,69.9 + ,116.8 + ,111.4 + ,120.1 + ,84 + ,125.5 + ,86.6 + ,97.5 + ,54.3 + ,104.2 + ,91.3 + ,107.7 + ,60 + ,115.1 + ,107.9 + ,127.3 + ,89.9 + ,132.8 + ,101.8 + ,117.2 + ,77 + ,123.3 + ,104.4 + ,119.8 + ,85.3 + ,124.8 + ,93.4 + ,116.2 + ,77.6 + ,122 + ,100.1 + ,111 + ,69.2 + ,117.4 + ,98.5 + ,112.4 + ,75.5 + ,117.9 + ,112.9 + ,130.6 + ,85.7 + ,137.4 + ,101.4 + ,109.1 + ,72.2 + ,114.6 + ,107.1 + ,118.8 + ,79.9 + ,124.7 + ,110.8 + ,123.9 + ,85.3 + ,129.6 + ,90.3 + ,101.6 + ,52.2 + ,109.4 + ,95.5 + ,112.8 + ,61.2 + ,120.9 + ,111.4 + ,128 + ,82.4 + ,134.9 + ,113 + ,129.6 + ,85.4 + ,136.3 + ,107.5 + ,125.8 + ,78.2 + ,133.2 + ,95.9 + ,119.5 + ,70.2 + ,127.2 + ,106.3 + ,115.7 + ,70.2 + ,122.7 + ,105.2 + ,113.6 + ,69.3 + ,120.5 + ,117.2 + ,129.7 + ,77.5 + ,137.8 + ,106.9 + ,112 + ,66.1 + ,119.1 + ,108.2 + ,116.8 + ,69 + ,124.3 + ,110 + ,126.3 + ,75.3 + ,134.3 + ,96.1 + ,112.9 + ,58.2 + ,121.7 + ,100.6 + ,115.9 + ,59.7 + ,125) + ,dim=c(4 + ,80) + ,dimnames=list(c('intermediaire' + ,'totaal' + ,'duurzame' + ,'niet-duurzame ') + ,1:80)) > y <- array(NA,dim=c(4,80),dimnames=list(c('intermediaire','totaal','duurzame','niet-duurzame '),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 = '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 80 members at h = 508] |--[dendrogram w/ 2 branches and 22 members at h = 71.9] | |--[dendrogram w/ 2 branches and 9 members at h = 47.8] | | |--[dendrogram w/ 2 branches and 3 members at h = 20.8] | | | |--leaf "10" | | | `--[dendrogram w/ 2 branches and 2 members at h = 12.4] | | | |--leaf "22" | | | `--leaf "27" | | `--[dendrogram w/ 2 branches and 6 members at h = 23.1] | | |--[dendrogram w/ 2 branches and 2 members at h = 8.33] | | | |--leaf "12" | | | `--leaf "13" | | `--[dendrogram w/ 2 branches and 4 members at h = 14.5] | | |--[dendrogram w/ 2 branches and 2 members at h = 5.32] | | | |--leaf "11" | | | `--leaf "23" | | `--[dendrogram w/ 2 branches and 2 members at h = 8.02] | | |--leaf "24" | | `--leaf "28" | `--[dendrogram w/ 2 branches and 13 members at h = 54.7] | |--[dendrogram w/ 2 branches and 6 members at h = 14.8] | | |--[dendrogram w/ 2 branches and 2 members at h = 8.58] | | | |--leaf "3" | | | `--leaf "21" | | `--[dendrogram w/ 2 branches and 4 members at h = 13.4] | | |--[dendrogram w/ 2 branches and 2 members at h = 3.57] | | | |--leaf "15" | | | `--leaf "18" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.24] | | |--leaf "6" | | `--leaf "9" | `--[dendrogram w/ 2 branches and 7 members at h = 17.8] | |--[dendrogram w/ 2 branches and 2 members at h = 3.14] | | |--leaf "5" | | `--leaf "16" | `--[dendrogram w/ 2 branches and 5 members at h = 11.9] | |--[dendrogram w/ 2 branches and 2 members at h = 4] | | |--leaf "1" | | `--leaf "2" | `--[dendrogram w/ 2 branches and 3 members at h = 6.71] | |--leaf "17" | `--[dendrogram w/ 2 branches and 2 members at h = 4.48] | |--leaf "4" | `--leaf "14" `--[dendrogram w/ 2 branches and 58 members at h = 404] |--[dendrogram w/ 2 branches and 16 members at h = 57.8] | |--[dendrogram w/ 2 branches and 7 members at h = 24.5] | | |--[dendrogram w/ 2 branches and 4 members at h = 11.6] | | | |--leaf "75" | | | `--[dendrogram w/ 2 branches and 3 members at h = 5.58] | | | |--leaf "69" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.52] | | | |--leaf "63" | | | `--leaf "70" | | `--[dendrogram w/ 2 branches and 3 members at h = 16.9] | | |--leaf "48" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.01] | | |--leaf "71" | | `--leaf "78" | `--[dendrogram w/ 2 branches and 9 members at h = 31.5] | |--[dendrogram w/ 2 branches and 4 members at h = 7.95] | | |--leaf "39" | | `--[dendrogram w/ 2 branches and 3 members at h = 6.07] | | |--leaf "66" | | `--[dendrogram w/ 2 branches and 2 members at h = 2.01] | | |--leaf "46" | | `--leaf "54" | `--[dendrogram w/ 2 branches and 5 members at h = 19.2] | |--[dendrogram w/ 2 branches and 2 members at h = 2.82] | | |--leaf "33" | | `--leaf "34" | `--[dendrogram w/ 2 branches and 3 members at h = 8] | |--leaf "57" | `--[dendrogram w/ 2 branches and 2 members at h = 6.56] | |--leaf "42" | `--leaf "45" `--[dendrogram w/ 2 branches and 42 members at h = 152] |--[dendrogram w/ 2 branches and 13 members at h = 72] | |--[dendrogram w/ 2 branches and 4 members at h = 18.0] | | |--[dendrogram w/ 2 branches and 2 members at h = 5.56] | | | |--leaf "19" | | | `--leaf "20" | | `--[dendrogram w/ 2 branches and 2 members at h = 10.5] | | |--leaf "7" | | `--leaf "8" | `--[dendrogram w/ 2 branches and 9 members at h = 36.5] | |--[dendrogram w/ 2 branches and 5 members at h = 11.7] | | |--[dendrogram w/ 2 branches and 2 members at h = 9.08] | | | |--leaf "26" | | | `--leaf "29" | | `--[dendrogram w/ 2 branches and 3 members at h = 9.42] | | |--leaf "37" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.03] | | |--leaf "38" | | `--leaf "41" | `--[dendrogram w/ 2 branches and 4 members at h = 17.9] | |--[dendrogram w/ 2 branches and 2 members at h = 3.54] | | |--leaf "25" | | `--leaf "35" | `--[dendrogram w/ 2 branches and 2 members at h = 3.55] | |--leaf "30" | `--leaf "40" `--[dendrogram w/ 2 branches and 29 members at h = 139] |--[dendrogram w/ 2 branches and 10 members at h = 47.8] | |--[dendrogram w/ 2 branches and 3 members at h = 8.12] | | |--leaf "55" | | `--[dendrogram w/ 2 branches and 2 members at h = 5.5] | | |--leaf "32" | | `--leaf "67" | `--[dendrogram w/ 2 branches and 7 members at h = 24.9] | |--[dendrogram w/ 2 branches and 3 members at h = 8.22] | | |--leaf "80" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.16] | | |--leaf "68" | | `--leaf "79" | `--[dendrogram w/ 2 branches and 4 members at h = 10.9] | |--leaf "43" | `--[dendrogram w/ 2 branches and 3 members at h = 7.57] | |--leaf "31" | `--[dendrogram w/ 2 branches and 2 members at h = 3.05] | |--leaf "44" | `--leaf "56" `--[dendrogram w/ 2 branches and 19 members at h = 70.1] |--[dendrogram w/ 2 branches and 8 members at h = 26.0] | |--[dendrogram w/ 2 branches and 5 members at h = 9.48] | | |--[dendrogram w/ 2 branches and 2 members at h = 3.93] | | | |--leaf "51" | | | `--leaf "59" | | `--[dendrogram w/ 2 branches and 3 members at h = 7.12] | | |--leaf "58" | | `--[dendrogram w/ 2 branches and 2 members at h = 2.91] | | |--leaf "47" | | `--leaf "65" | `--[dendrogram w/ 2 branches and 3 members at h = 12.4] | |--leaf "72" | `--[dendrogram w/ 2 branches and 2 members at h = 9.65] | |--leaf "36" | `--leaf "60" `--[dendrogram w/ 2 branches and 11 members at h = 37.4] |--[dendrogram w/ 2 branches and 4 members at h = 8.19] | |--[dendrogram w/ 2 branches and 2 members at h = 2.97] | | |--leaf "73" | | `--leaf "77" | `--[dendrogram w/ 2 branches and 2 members at h = 4.2] | |--leaf "74" | `--leaf "76" `--[dendrogram w/ 2 branches and 7 members at h = 14.2] |--[dendrogram w/ 2 branches and 2 members at h = 5.37] | |--leaf "49" | `--leaf "50" `--[dendrogram w/ 2 branches and 5 members at h = 9.03] |--[dendrogram w/ 2 branches and 2 members at h = 4.03] | |--leaf "52" | `--leaf "62" `--[dendrogram w/ 2 branches and 3 members at h = 5.56] |--leaf "64" `--[dendrogram w/ 2 branches and 2 members at h = 1.97] |--leaf "53" `--leaf "61" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/15mtb1194694085.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/208ax1194694086.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/3kis61194694086.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/4lefk1194694086.tab") + } > > system("convert tmp/15mtb1194694085.ps tmp/15mtb1194694085.png") > system("convert tmp/208ax1194694086.ps tmp/208ax1194694086.png") convert: unable to open image `tmp/208ax1194694086.ps': No such file or directory. convert: missing an image filename `tmp/208ax1194694086.png'. > > > proc.time() user system elapsed 0.918 0.217 1.084