R version 2.7.2 (2008-08-25) Copyright (C) 2008 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(97.6 + ,89.6 + ,6.4 + ,9.1 + ,96.9 + ,92.8 + ,6.3 + ,9.0 + ,105.6 + ,107.6 + ,6.3 + ,8.6 + ,102.8 + ,104.6 + ,6.4 + ,7.9 + ,101.7 + ,103.0 + ,6.3 + ,7.7 + ,104.2 + ,106.9 + ,6.0 + ,7.8 + ,92.7 + ,56.3 + ,6.2 + ,9.1 + ,91.9 + ,93.4 + ,6.3 + ,9.4 + ,106.5 + ,109.1 + ,6.6 + ,9.3 + ,112.3 + ,113.8 + ,7.5 + ,8.7 + ,102.8 + ,97.4 + ,7.8 + ,8.4 + ,96.5 + ,72.5 + ,7.9 + ,8.6 + ,101.0 + ,82.7 + ,7.8 + ,9.0 + ,98.9 + ,88.9 + ,7.6 + ,9.1 + ,105.1 + ,105.9 + ,7.5 + ,8.7 + ,103.0 + ,100.8 + ,7.6 + ,8.2 + ,99.0 + ,94.0 + ,7.5 + ,7.9 + ,104.3 + ,105.0 + ,7.3 + ,7.9 + ,94.6 + ,58.5 + ,7.6 + ,9.1 + ,90.4 + ,87.6 + ,7.5 + ,9.4 + ,108.9 + ,113.1 + ,7.6 + ,9.5 + ,111.4 + ,112.5 + ,7.9 + ,9.1 + ,100.8 + ,89.6 + ,7.9 + ,9.0 + ,102.5 + ,74.5 + ,8.1 + ,9.3 + ,98.2 + ,82.7 + ,8.2 + ,9.9 + ,98.7 + ,90.1 + ,8.0 + ,9.8 + ,113.3 + ,109.4 + ,7.5 + ,9.4 + ,104.6 + ,96.0 + ,6.8 + ,8.3 + ,99.3 + ,89.2 + ,6.5 + ,8.0 + ,111.8 + ,109.1 + ,6.6 + ,8.5 + ,97.3 + ,49.1 + ,7.6 + ,10.4 + ,97.7 + ,92.9 + ,8.0 + ,11.1 + ,115.6 + ,107.7 + ,8.0 + ,10.9 + ,111.9 + ,103.5 + ,7.7 + ,9.9 + ,107.0 + ,91.1 + ,7.5 + ,9.2 + ,107.1 + ,79.8 + ,7.6 + ,9.2 + ,100.6 + ,71.9 + ,7.7 + ,9.5 + ,99.2 + ,82.9 + ,7.9 + ,9.6 + ,108.4 + ,90.1 + ,7.8 + ,9.5 + ,103.0 + ,100.7 + ,7.5 + ,9.1 + ,99.8 + ,90.7 + ,7.5 + ,8.9 + ,115.0 + ,108.8 + ,7.1 + ,9.0 + ,90.8 + ,44.1 + ,7.5 + ,10.1 + ,95.9 + ,93.6 + ,7.5 + ,10.3 + ,114.4 + ,107.4 + ,7.6 + ,10.2 + ,108.2 + ,96.5 + ,7.7 + ,9.6 + ,112.6 + ,93.6 + ,7.7 + ,9.2 + ,109.1 + ,76.5 + ,7.9 + ,9.3 + ,105.0 + ,76.7 + ,8.1 + ,9.4 + ,105.0 + ,84.0 + ,8.2 + ,9.4 + ,118.5 + ,103.3 + ,8.2 + ,9.2 + ,103.7 + ,88.5 + ,8.1 + ,9.0 + ,112.5 + ,99.0 + ,7.9 + ,9.0 + ,116.6 + ,105.9 + ,7.3 + ,9.0 + ,96.6 + ,44.7 + ,6.9 + ,9.8 + ,101.9 + ,94.0 + ,6.6 + ,10.0 + ,116.5 + ,107.1 + ,6.7 + ,9.9 + ,119.3 + ,104.8 + ,6.9 + ,9.3 + ,115.4 + ,102.5 + ,7.0 + ,9.0 + ,108.5 + ,77.7 + ,7.1 + ,9.0 + ,111.5 + ,85.2 + ,7.2 + ,9.1 + ,108.8 + ,91.3 + ,7.1 + ,9.1 + ,121.8 + ,106.5 + ,6.9 + ,9.1 + ,109.6 + ,92.4 + ,7.0 + ,9.2 + ,112.2 + ,97.5 + ,6.8 + ,8.8 + ,119.6 + ,107.0 + ,6.4 + ,8.3 + ,104.1 + ,51.1 + ,6.7 + ,8.4 + ,105.3 + ,98.6 + ,6.7 + ,8.1 + ,115.0 + ,102.2 + ,6.4 + ,7.8 + ,124.1 + ,114.3 + ,6.3 + ,7.9 + ,116.8 + ,99.4 + ,6.2 + ,7.9 + ,107.5 + ,72.5 + ,6.5 + ,8.0 + ,115.6 + ,92.3 + ,6.8 + ,7.9 + ,116.2 + ,99.4 + ,6.8 + ,7.5 + ,116.3 + ,85.9 + ,6.5 + ,7.2 + ,119.0 + ,109.4 + ,6.3 + ,6.9 + ,111.9 + ,97.6 + ,5.9 + ,6.6 + ,118.6 + ,104.7 + ,5.9 + ,6.7 + ,106.7 + ,56.5 + ,6.4 + ,7.3) + ,dim=c(4 + ,79) + ,dimnames=list(c('Tot' + ,'Bouw' + ,'WerkloosM' + ,'WerkloosV') + ,1:79)) > y <- array(NA,dim=c(4,79),dimnames=list(c('Tot','Bouw','WerkloosM','WerkloosV'),1:79)) > 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: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.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 79 members at h = 538] |--[dendrogram w/ 2 branches and 46 members at h = 141] | |--[dendrogram w/ 2 branches and 17 members at h = 31.5] | | |--[dendrogram w/ 2 branches and 7 members at h = 13.9] | | | |--leaf "70" | | | `--[dendrogram w/ 2 branches and 6 members at h = 6.78] | | | |--[dendrogram w/ 2 branches and 3 members at h = 3.65] | | | | |--leaf "78" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 2.14] | | | | |--leaf "51" | | | | `--leaf "58" | | | `--[dendrogram w/ 2 branches and 3 members at h = 4.17] | | | |--leaf "76" | | | `--[dendrogram w/ 2 branches and 2 members at h = 2.45] | | | |--leaf "63" | | | `--leaf "66" | | `--[dendrogram w/ 2 branches and 10 members at h = 19.4] | | |--[dendrogram w/ 2 branches and 3 members at h = 3.56] | | | |--leaf "21" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.68] | | | |--leaf "10" | | | `--leaf "22" | | `--[dendrogram w/ 2 branches and 7 members at h = 7.16] | | |--[dendrogram w/ 2 branches and 3 members at h = 2.89] | | | |--leaf "30" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.89] | | | |--leaf "27" | | | `--leaf "42" | | `--[dendrogram w/ 2 branches and 4 members at h = 3.51] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.48] | | | |--leaf "33" | | | `--leaf "45" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.62] | | |--leaf "54" | | `--leaf "57" | `--[dendrogram w/ 2 branches and 29 members at h = 87.8] | |--[dendrogram w/ 2 branches and 13 members at h = 28.1] | | |--[dendrogram w/ 2 branches and 5 members at h = 4.54] | | | |--[dendrogram w/ 2 branches and 2 members at h = 1.46] | | | | |--leaf "15" | | | | `--leaf "18" | | | `--[dendrogram w/ 2 branches and 3 members at h = 3.06] | | | |--leaf "9" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.78] | | | |--leaf "3" | | | `--leaf "6" | | `--[dendrogram w/ 2 branches and 8 members at h = 14.9] | | |--[dendrogram w/ 2 branches and 4 members at h = 5.42] | | | |--leaf "46" | | | `--[dendrogram w/ 2 branches and 3 members at h = 2.97] | | | |--leaf "68" | | | `--[dendrogram w/ 2 branches and 2 members at h = 2.49] | | | |--leaf "11" | | | `--leaf "28" | | `--[dendrogram w/ 2 branches and 4 members at h = 5.75] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.911] | | | |--leaf "16" | | | `--leaf "40" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.95] | | |--leaf "4" | | `--leaf "5" | `--[dendrogram w/ 2 branches and 16 members at h = 46.9] | |--[dendrogram w/ 2 branches and 6 members at h = 16.7] | | |--[dendrogram w/ 2 branches and 4 members at h = 2.95] | | | |--[dendrogram w/ 2 branches and 2 members at h = 1.37] | | | | |--leaf "62" | | | | `--leaf "64" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.77] | | | |--leaf "35" | | | `--leaf "39" | | `--[dendrogram w/ 2 branches and 2 members at h = 5.26] | | |--leaf "61" | | `--leaf "75" | `--[dendrogram w/ 2 branches and 10 members at h = 17.1] | |--[dendrogram w/ 2 branches and 5 members at h = 7.71] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.938] | | | |--leaf "71" | | | `--leaf "74" | | `--[dendrogram w/ 2 branches and 3 members at h = 4.85] | | |--leaf "34" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.43] | | |--leaf "59" | | `--leaf "69" | `--[dendrogram w/ 2 branches and 5 members at h = 9.78] | |--[dendrogram w/ 2 branches and 3 members at h = 3.28] | | |--leaf "77" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.89] | | |--leaf "53" | | `--leaf "65" | `--[dendrogram w/ 2 branches and 2 members at h = 3.63] | |--leaf "47" | `--leaf "73" `--[dendrogram w/ 2 branches and 33 members at h = 270] |--[dendrogram w/ 2 branches and 7 members at h = 23.7] | |--[dendrogram w/ 2 branches and 3 members at h = 7.87] | | |--leaf "43" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.55] | | |--leaf "31" | | `--leaf "55" | `--[dendrogram w/ 2 branches and 4 members at h = 20.9] | |--[dendrogram w/ 2 branches and 2 members at h = 3.23] | | |--leaf "7" | | `--leaf "19" | `--[dendrogram w/ 2 branches and 2 members at h = 6.1] | |--leaf "67" | `--leaf "79" `--[dendrogram w/ 2 branches and 26 members at h = 111] |--[dendrogram w/ 2 branches and 8 members at h = 21.1] | |--[dendrogram w/ 2 branches and 3 members at h = 5.99] | | |--leaf "12" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.25] | | |--leaf "24" | | `--leaf "37" | `--[dendrogram w/ 2 branches and 5 members at h = 7.21] | |--leaf "72" | `--[dendrogram w/ 2 branches and 4 members at h = 4.5] | |--leaf "49" | `--[dendrogram w/ 2 branches and 3 members at h = 3.77] | |--leaf "36" | `--[dendrogram w/ 2 branches and 2 members at h = 1.59] | |--leaf "48" | `--leaf "60" `--[dendrogram w/ 2 branches and 18 members at h = 35.2] |--[dendrogram w/ 2 branches and 5 members at h = 11.1] | |--[dendrogram w/ 2 branches and 3 members at h = 2.88] | | |--leaf "13" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.10] | | |--leaf "25" | | `--leaf "38" | `--[dendrogram w/ 2 branches and 2 members at h = 4.7] | |--leaf "50" | `--leaf "52" `--[dendrogram w/ 2 branches and 13 members at h = 17.7] |--[dendrogram w/ 2 branches and 2 members at h = 6.11] | |--leaf "8" | `--leaf "20" `--[dendrogram w/ 2 branches and 11 members at h = 13.2] |--[dendrogram w/ 2 branches and 6 members at h = 3.22] | |--[dendrogram w/ 2 branches and 2 members at h = 1.54] | | |--leaf "23" | | `--leaf "41" | `--[dendrogram w/ 2 branches and 4 members at h = 2.36] | |--[dendrogram w/ 2 branches and 2 members at h = 1.46] | | |--leaf "14" | | `--leaf "26" | `--[dendrogram w/ 2 branches and 2 members at h = 2.07] | |--leaf "1" | `--leaf "29" `--[dendrogram w/ 2 branches and 5 members at h = 6.5] |--[dendrogram w/ 2 branches and 3 members at h = 2.62] | |--leaf "2" | `--[dendrogram w/ 2 branches and 2 members at h = 2.15] | |--leaf "32" | `--leaf "44" `--[dendrogram w/ 2 branches and 2 members at h = 3.69] |--leaf "17" `--leaf "56" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1f6s81226417268.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/258291226417268.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) + } > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > 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/3g1tp1226417268.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/4jvz41226417268.tab") + } > > system("convert tmp/1f6s81226417268.ps tmp/1f6s81226417268.png") > system("convert tmp/258291226417268.ps tmp/258291226417268.png") convert: unable to open image `tmp/258291226417268.ps': No such file or directory. convert: missing an image filename `tmp/258291226417268.png'. > > > proc.time() user system elapsed 0.877 0.208 1.141