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(91.19 + ,1.79 + ,89.28 + ,92.58 + ,91.53 + ,1.95 + ,89.47 + ,93.15 + ,91.88 + ,2.26 + ,89.53 + ,93.7 + ,92.06 + ,2.04 + ,90.72 + ,93.34 + ,92.32 + ,2.16 + ,90.91 + ,93.93 + ,92.67 + ,2.75 + ,91.38 + ,94.41 + ,92.85 + ,2.79 + ,91.49 + ,94.3 + ,92.82 + ,2.88 + ,90.9 + ,94.44 + ,93.46 + ,3.36 + ,90.93 + ,96.09 + ,93.23 + ,2.97 + ,90.57 + ,95.99 + ,93.54 + ,3.1 + ,91.28 + ,96.23 + ,93.29 + ,2.49 + ,90.83 + ,95.64 + ,93.2 + ,2.2 + ,91.5 + ,94.88 + ,93.6 + ,2.25 + ,91.58 + ,95.48 + ,93.81 + ,2.09 + ,92.49 + ,95.52 + ,94.62 + ,2.79 + ,94.16 + ,96.18 + ,95.22 + ,3.14 + ,95.46 + ,96.82 + ,95.38 + ,2.93 + ,95.8 + ,96.81 + ,95.31 + ,2.65 + ,95.32 + ,96.25 + ,95.3 + ,2.67 + ,95.41 + ,96.24 + ,95.57 + ,2.26 + ,95.35 + ,96.95 + ,95.42 + ,2.35 + ,95.68 + ,96.25 + ,95.53 + ,2.13 + ,95.59 + ,96.04 + ,95.33 + ,2.18 + ,94.96 + ,95.78 + ,95.9 + ,2.9 + ,96.92 + ,95.86 + ,96.06 + ,2.63 + ,96.06 + ,96.02 + ,96.31 + ,2.67 + ,96.59 + ,96.34 + ,96.34 + ,1.81 + ,96.67 + ,96.84 + ,96.49 + ,1.33 + ,97.27 + ,96.73 + ,96.22 + ,0.88 + ,96.38 + ,96.34 + ,96.53 + ,1.28 + ,96.47 + ,96.6 + ,96.5 + ,1.26 + ,96.05 + ,96.64 + ,96.77 + ,1.26 + ,96.76 + ,97.2 + ,96.66 + ,1.29 + ,96.51 + ,97.5 + ,96.58 + ,1.1 + ,96.55 + ,96.99 + ,96.63 + ,1.37 + ,95.97 + ,97.08 + ,97.06 + ,1.21 + ,97 + ,97.55 + ,97.73 + ,1.74 + ,97.46 + ,98.42 + ,98.01 + ,1.76 + ,97.9 + ,98.78 + ,97.76 + ,1.48 + ,98.42 + ,97.49 + ,97.49 + ,1.04 + ,98.54 + ,96.99 + ,97.77 + ,1.62 + ,99 + ,97.16 + ,97.96 + ,1.49 + ,98.94 + ,97.29 + ,98.23 + ,1.79 + ,99.02 + ,97.8 + ,98.51 + ,1.8 + ,100.07 + ,98.12 + ,98.19 + ,1.58 + ,98.72 + ,98.03 + ,98.37 + ,1.86 + ,98.73 + ,98.11 + ,98.31 + ,1.74 + ,98.04 + ,98.07 + ,98.6 + ,1.59 + ,99.08 + ,98.21 + ,98.97 + ,1.26 + ,99.22 + ,98.48 + ,99.11 + ,1.13 + ,99.57 + ,98.83 + ,99.64 + ,1.92 + ,100.44 + ,99.2 + ,100.03 + ,2.61 + ,100.84 + ,99.88 + ,99.98 + ,2.26 + ,100.75 + ,99.71 + ,100.32 + ,2.41 + ,100.49 + ,100.03 + ,100.44 + ,2.26 + ,99.98 + ,100.6 + ,100.51 + ,2.03 + ,99.96 + ,100.85 + ,101 + ,2.86 + ,99.76 + ,101.96 + ,100.88 + ,2.55 + ,100.11 + ,101.4 + ,100.55 + ,2.27 + ,99.79 + ,100.81 + ,100.83 + ,2.26 + ,100.29 + ,100.66 + ,101.51 + ,2.57 + ,101.12 + ,101.55 + ,102.16 + ,3.07 + ,102.65 + ,102.23 + ,102.39 + ,2.76 + ,102.71 + ,102.9 + ,102.54 + ,2.51 + ,103.39 + ,102.68 + ,102.85 + ,2.87 + ,102.8 + ,103.41 + ,103.47 + ,3.14 + ,102.07 + ,104.62 + ,103.57 + ,3.11 + ,102.15 + ,104.93 + ,103.69 + ,3.16 + ,101.21 + ,105.88 + ,103.5 + ,2.47 + ,101.27 + ,105.18 + ,103.47 + ,2.57 + ,101.86 + ,104.54 + ,103.45 + ,2.89 + ,101.65 + ,104.58 + ,103.48 + ,2.63 + ,101.94 + ,104.34 + ,103.93 + ,2.38 + ,102.62 + ,104.66 + ,103.89 + ,1.69 + ,102.71 + ,104.73 + ,104.4 + ,1.96 + ,103.39 + ,105.44 + ,104.79 + ,2.19 + ,104.51 + ,105.72 + ,104.77 + ,1.87 + ,104.09 + ,105.68 + ,105.13 + ,1.6 + ,104.29 + ,105.9 + ,105.26 + ,1.63 + ,104.57 + ,105.97 + ,104.96 + ,1.22 + ,105.39 + ,105.21 + ,104.75 + ,1.21 + ,105.15 + ,104.75 + ,105.01 + ,1.49 + ,106.13 + ,104.89 + ,105.15 + ,1.64 + ,105.46 + ,105.26 + ,105.2 + ,1.66 + ,106.47 + ,104.84 + ,105.77 + ,1.77 + ,106.62 + ,105.47 + ,105.78 + ,1.82 + ,106.52 + ,105.4 + ,106.26 + ,1.78 + ,108.04 + ,105.73 + ,106.13 + ,1.28 + ,107.15 + ,105.72 + ,106.12 + ,1.29 + ,107.32 + ,105.63 + ,106.57 + ,1.37 + ,107.76 + ,105.97 + ,106.44 + ,1.12 + ,107.26 + ,105.92 + ,106.54 + ,1.51 + ,107.89 + ,106.32) + ,dim=c(4 + ,93) + ,dimnames=list(c('algindex' + ,'indexcons' + ,'voeding' + ,'ntvoeding') + ,1:93)) > y <- array(NA,dim=c(4,93),dimnames=list(c('algindex','indexcons','voeding','ntvoeding'),1:93)) > 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 93 members at h = 395] |--[dendrogram w/ 2 branches and 31 members at h = 48.5] | |--[dendrogram w/ 2 branches and 14 members at h = 10.0] | | |--[dendrogram w/ 2 branches and 4 members at h = 1.21] | | | |--leaf "63" | | | `--[dendrogram w/ 2 branches and 3 members at h = 0.982] | | | |--leaf "65" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.701] | | | |--leaf "64" | | | `--leaf "66" | | `--[dendrogram w/ 2 branches and 10 members at h = 4.11] | | |--[dendrogram w/ 2 branches and 3 members at h = 1.37] | | | |--leaf "76" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.7] | | | |--leaf "74" | | | `--leaf "75" | | `--[dendrogram w/ 2 branches and 7 members at h = 2.34] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.00] | | | |--leaf "69" | | | `--leaf "70" | | `--[dendrogram w/ 2 branches and 5 members at h = 1.07] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.337] | | | |--leaf "67" | | | `--leaf "68" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.488] | | |--leaf "72" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.224] | | |--leaf "71" | | `--leaf "73" | `--[dendrogram w/ 2 branches and 17 members at h = 13.3] | |--[dendrogram w/ 2 branches and 6 members at h = 1.72] | | |--[dendrogram w/ 2 branches and 3 members at h = 0.526] | | | |--leaf "92" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.193] | | | |--leaf "89" | | | `--leaf "90" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.77] | | |--leaf "88" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.4] | | |--leaf "91" | | `--leaf "93" | `--[dendrogram w/ 2 branches and 11 members at h = 6.27] | |--[dendrogram w/ 2 branches and 4 members at h = 0.993] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.318] | | | |--leaf "79" | | | `--leaf "80" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.53] | | |--leaf "77" | | `--leaf "78" | `--[dendrogram w/ 2 branches and 7 members at h = 2.96] | |--[dendrogram w/ 2 branches and 3 members at h = 0.775] | | |--leaf "82" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.469] | | |--leaf "81" | | `--leaf "84" | `--[dendrogram w/ 2 branches and 4 members at h = 1.65] | |--[dendrogram w/ 2 branches and 2 members at h = 0.132] | | |--leaf "86" | | `--leaf "87" | `--[dendrogram w/ 2 branches and 2 members at h = 0.428] | |--leaf "83" | `--leaf "85" `--[dendrogram w/ 2 branches and 62 members at h = 145] |--[dendrogram w/ 2 branches and 15 members at h = 10.9] | |--[dendrogram w/ 2 branches and 7 members at h = 3.29] | | |--[dendrogram w/ 2 branches and 4 members at h = 1.14] | | | |--[dendrogram w/ 2 branches and 2 members at h = 0.465] | | | | |--leaf "9" | | | | `--leaf "11" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.651] | | | |--leaf "10" | | | `--leaf "12" | | `--[dendrogram w/ 2 branches and 3 members at h = 1.28] | | |--leaf "15" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.727] | | |--leaf "13" | | `--leaf "14" | `--[dendrogram w/ 2 branches and 8 members at h = 5.95] | |--[dendrogram w/ 2 branches and 3 members at h = 1.19] | | |--leaf "3" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.709] | | |--leaf "1" | | `--leaf "2" | `--[dendrogram w/ 2 branches and 5 members at h = 2.36] | |--[dendrogram w/ 2 branches and 3 members at h = 0.676] | | |--leaf "8" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.241] | | |--leaf "6" | | `--leaf "7" | `--[dendrogram w/ 2 branches and 2 members at h = 0.683] | |--leaf "4" | `--leaf "5" `--[dendrogram w/ 2 branches and 47 members at h = 79.6] |--[dendrogram w/ 2 branches and 22 members at h = 14.3] | |--[dendrogram w/ 2 branches and 10 members at h = 2.00] | | |--[dendrogram w/ 2 branches and 4 members at h = 0.875] | | | |--leaf "30" | | | `--[dendrogram w/ 2 branches and 3 members at h = 0.649] | | | |--leaf "36" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.423] | | | |--leaf "31" | | | `--leaf "32" | | `--[dendrogram w/ 2 branches and 6 members at h = 1.37] | | |--[dendrogram w/ 2 branches and 4 members at h = 0.79] | | | |--leaf "37" | | | `--[dendrogram w/ 2 branches and 3 members at h = 0.51] | | | |--leaf "34" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.387] | | | |--leaf "33" | | | `--leaf "35" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.79] | | |--leaf "28" | | `--leaf "29" | `--[dendrogram w/ 2 branches and 12 members at h = 4.2] | |--[dendrogram w/ 2 branches and 3 members at h = 0.896] | | |--leaf "25" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.669] | | |--leaf "26" | | `--leaf "27" | `--[dendrogram w/ 2 branches and 9 members at h = 2.24] | |--leaf "16" | `--[dendrogram w/ 2 branches and 8 members at h = 1.97] | |--[dendrogram w/ 2 branches and 5 members at h = 0.998] | | |--leaf "24" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.897] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.0933] | | | |--leaf "19" | | | `--leaf "20" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.336] | | |--leaf "22" | | `--leaf "23" | `--[dendrogram w/ 2 branches and 3 members at h = 1.06] | |--leaf "21" | `--[dendrogram w/ 2 branches and 2 members at h = 0.431] | |--leaf "17" | `--leaf "18" `--[dendrogram w/ 2 branches and 25 members at h = 34] |--[dendrogram w/ 2 branches and 14 members at h = 4.34] | |--[dendrogram w/ 2 branches and 7 members at h = 2.40] | | |--[dendrogram w/ 2 branches and 4 members at h = 0.632] | | | |--leaf "49" | | | `--[dendrogram w/ 2 branches and 3 members at h = 0.477] | | | |--leaf "44" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.342] | | | |--leaf "46" | | | `--leaf "47" | | `--[dendrogram w/ 2 branches and 3 members at h = 1.43] | | |--leaf "45" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.531] | | |--leaf "50" | | `--leaf "51" | `--[dendrogram w/ 2 branches and 7 members at h = 3.93] | |--[dendrogram w/ 2 branches and 3 members at h = 0.906] | | |--leaf "48" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.634] | | |--leaf "38" | | `--leaf "39" | `--[dendrogram w/ 2 branches and 4 members at h = 0.952] | |--[dendrogram w/ 2 branches and 2 members at h = 0.271] | | |--leaf "42" | | `--leaf "43" | `--[dendrogram w/ 2 branches and 2 members at h = 0.729] | |--leaf "40" | `--leaf "41" `--[dendrogram w/ 2 branches and 11 members at h = 5.57] |--[dendrogram w/ 2 branches and 4 members at h = 1.29] | |--leaf "52" | `--[dendrogram w/ 2 branches and 3 members at h = 0.582] | |--leaf "55" | `--[dendrogram w/ 2 branches and 2 members at h = 0.402] | |--leaf "53" | `--leaf "54" `--[dendrogram w/ 2 branches and 7 members at h = 2.78] |--[dendrogram w/ 2 branches and 4 members at h = 0.663] | |--leaf "61" | `--[dendrogram w/ 2 branches and 3 members at h = 0.334] | |--leaf "56" | `--[dendrogram w/ 2 branches and 2 members at h = 0.299] | |--leaf "57" | `--leaf "60" `--[dendrogram w/ 2 branches and 3 members at h = 1.58] |--leaf "62" `--[dendrogram w/ 2 branches and 2 members at h = 0.74] |--leaf "58" `--leaf "59" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/11wmt1194257539.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/2mqal1194257539.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/3siye1194257540.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/4mwkf1194257540.tab") + } > > system("convert tmp/11wmt1194257539.ps tmp/11wmt1194257539.png") > system("convert tmp/2mqal1194257539.ps tmp/2mqal1194257539.png") convert: unable to open image `tmp/2mqal1194257539.ps': No such file or directory. convert: missing an image filename `tmp/2mqal1194257539.png'. > > > proc.time() user system elapsed 0.984 0.224 1.099