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(7.4 + ,6.2 + ,9.0 + ,7.2 + ,6.1 + ,8.8 + ,7.1 + ,5.9 + ,8.7 + ,6.9 + ,5.6 + ,8.7 + ,6.8 + ,5.5 + ,8.6 + ,6.8 + ,5.5 + ,8.6 + ,6.8 + ,5.6 + ,8.5 + ,6.9 + ,5.7 + ,8.5 + ,6.7 + ,5.6 + ,8.3 + ,6.6 + ,5.4 + ,8.2 + ,6.5 + ,5.3 + ,8.1 + ,6.4 + ,5.3 + ,7.8 + ,6.3 + ,5.4 + ,7.5 + ,6.3 + ,5.5 + ,7.4 + ,6.3 + ,5.6 + ,7.3 + ,6.5 + ,5.7 + ,7.7 + ,6.6 + ,5.8 + ,7.7 + ,6.5 + ,5.8 + ,7.6 + ,6.4 + ,5.7 + ,7.3 + ,6.5 + ,5.9 + ,7.2 + ,6.7 + ,6.1 + ,7.5 + ,7.1 + ,6.4 + ,8.0 + ,7.1 + ,6.4 + ,8.1 + ,7.2 + ,6.3 + ,8.4 + ,7.2 + ,6.2 + ,8.6 + ,7.3 + ,6.2 + ,8.7 + ,7.3 + ,6.3 + ,8.6 + ,7.3 + ,6.5 + ,8.4 + ,7.3 + ,6.6 + ,8.4 + ,7.4 + ,6.6 + ,8.5 + ,7.6 + ,6.7 + ,8.9 + ,7.6 + ,6.6 + ,8.8 + ,7.6 + ,6.7 + ,8.7 + ,7.7 + ,7.0 + ,8.6 + ,7.8 + ,7.2 + ,8.6 + ,7.9 + ,7.3 + ,8.6 + ,8.1 + ,7.5 + ,8.8 + ,8.1 + ,7.6 + ,8.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+ ,9.0 + ,7.9 + ,6.8 + ,9.2 + ,7.8 + ,6.8 + ,9.0 + ,7.6 + ,6.7 + ,8.7 + ,7.4 + ,6.8 + ,8.3 + ,7.3 + ,6.7 + ,8.0 + ,7.1 + ,6.6 + ,7.7 + ,7.1 + ,6.4 + ,7.9 + ,7.0 + ,6.4 + ,7.9 + ,7.0 + ,6.4 + ,7.8 + ,7.0 + ,6.5 + ,7.7 + ,6.9 + ,6.5 + ,7.5 + ,6.8 + ,6.4 + ,7.3 + ,6.7 + ,6.3 + ,7.2 + ,6.6 + ,6.2 + ,7.1 + ,6.6 + ,6.3 + ,7.1) + ,dim=c(3 + ,102) + ,dimnames=list(c('Totaal' + ,'Mannen' + ,'Vrouwen') + ,1:102)) > y <- array(NA,dim=c(3,102),dimnames=list(c('Totaal','Mannen','Vrouwen'),1:102)) > 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 = 'complete' > 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 102 members at h = 4.23] |--[dendrogram w/ 2 branches and 60 members at h = 2.03] | |--[dendrogram w/ 2 branches and 20 members at h = 1.10] | | |--[dendrogram w/ 2 branches and 9 members at h = 0.64] | | | |--[dendrogram w/ 2 branches and 5 members at h = 0.332] | | | | |--leaf "88" | | | | `--[dendrogram w/ 2 branches and 4 members at h = 0.245] | | | | |--leaf "84" | | | | `--[dendrogram w/ 2 branches and 3 members at h = 0.1] | | | | |--leaf "83" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | | | |--leaf "52" | | | | `--leaf "53" | | | `--[dendrogram w/ 2 branches and 4 members at h = 0.361] | | | |--leaf "80" | | | `--[dendrogram w/ 2 branches and 3 members at h = 0.224] | | | |--leaf "82" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | | |--leaf "79" | | | `--leaf "81" | | `--[dendrogram w/ 2 branches and 11 members at h = 0.787] | | |--[dendrogram w/ 2 branches and 3 members at h = 0.361] | | | |--leaf "34" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.141] | | | |--leaf "35" | | | `--leaf "36" | | `--[dendrogram w/ 2 branches and 8 members at h = 0.412] | | |--[dendrogram w/ 2 branches and 4 members at h = 0.2] | | | |--[dendrogram w/ 2 branches and 2 members at h = 0] | | | | |--leaf "33" | | | | `--leaf "90" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.141] | | | |--leaf "31" | | | `--leaf "32" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.224] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.1] | | | |--leaf "85" | | | `--leaf "89" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.141] | | |--leaf "86" | | `--leaf "87" | `--[dendrogram w/ 2 branches and 40 members at h = 1.40] | |--[dendrogram w/ 2 branches and 11 members at h = 0.412] | | |--[dendrogram w/ 2 branches and 5 members at h = 0.245] | | | |--[dendrogram w/ 2 branches and 2 members at h = 0.1] | | | | |--leaf "46" | | | | `--leaf "47" | | | `--[dendrogram w/ 2 branches and 3 members at h = 0.141] | | | |--leaf "45" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | | |--leaf "43" | | | `--leaf "44" | | `--[dendrogram w/ 2 branches and 6 members at h = 0.332] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.1] | | | |--leaf "37" | | | `--leaf "38" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.173] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.1] | | | |--leaf "41" | | | `--leaf "42" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.141] | | |--leaf "39" | | `--leaf "40" | `--[dendrogram w/ 2 branches and 29 members at h = 0.949] | |--[dendrogram w/ 2 branches and 3 members at h = 0.245] | | |--leaf "55" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.141] | | |--leaf "56" | | `--leaf "57" | `--[dendrogram w/ 2 branches and 26 members at h = 0.728] | |--[dendrogram w/ 2 branches and 13 members at h = 0.458] | | |--[dendrogram w/ 2 branches and 5 members at h = 0.224] | | | |--[dendrogram w/ 2 branches and 2 members at h = 0.1] | | | | |--leaf "48" | | | | `--leaf "76" | | | `--[dendrogram w/ 2 branches and 3 members at h = 0.141] | | | |--leaf "75" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | | |--leaf "49" | | | `--leaf "77" | | `--[dendrogram w/ 2 branches and 8 members at h = 0.245] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.1] | | | |--leaf "73" | | | `--leaf "74" | | `--[dendrogram w/ 2 branches and 6 members at h = 0.141] | | |--[dendrogram w/ 2 branches and 2 members at h = 0] | | | |--leaf "71" | | | `--leaf "72" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.1] | | |--leaf "65" | | `--[dendrogram w/ 2 branches and 3 members at h = 0] | | |--leaf "70" | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | |--leaf "64" | | `--leaf "66" | `--[dendrogram w/ 2 branches and 13 members at h = 0.469] | |--[dendrogram w/ 2 branches and 10 members at h = 0.224] | | |--[dendrogram w/ 2 branches and 4 members at h = 0.1] | | | |--[dendrogram w/ 2 branches and 2 members at h = 0] | | | | |--leaf "50" | | | | `--leaf "68" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | | |--leaf "67" | | | `--leaf "69" | | `--[dendrogram w/ 2 branches and 6 members at h = 0.173] | | |--[dendrogram w/ 2 branches and 3 members at h = 0] | | | |--leaf "63" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | | |--leaf "58" | | | `--leaf "62" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.1] | | |--leaf "60" | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | |--leaf "59" | | `--leaf "61" | `--[dendrogram w/ 2 branches and 3 members at h = 0.224] | |--leaf "54" | `--[dendrogram w/ 2 branches and 2 members at h = 0.1] | |--leaf "51" | `--leaf "78" `--[dendrogram w/ 2 branches and 42 members at h = 2.11] |--[dendrogram w/ 2 branches and 20 members at h = 1.48] | |--[dendrogram w/ 2 branches and 5 members at h = 0.64] | | |--leaf "12" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.374] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.141] | | | |--leaf "13" | | | `--leaf "14" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.141] | | |--leaf "15" | | `--leaf "19" | `--[dendrogram w/ 2 branches and 15 members at h = 1.08] | |--[dendrogram w/ 2 branches and 6 members at h = 0.458] | | |--leaf "98" | | `--[dendrogram w/ 2 branches and 5 members at h = 0.3] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.141] | | | |--leaf "93" | | | `--leaf "97" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.141] | | |--leaf "96" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.1] | | |--leaf "94" | | `--leaf "95" | `--[dendrogram w/ 2 branches and 9 members at h = 0.86] | |--[dendrogram w/ 2 branches and 4 members at h = 0.346] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.1] | | | |--leaf "101" | | | `--leaf "102" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.173] | | |--leaf "99" | | `--leaf "100" | `--[dendrogram w/ 2 branches and 5 members at h = 0.539] | |--[dendrogram w/ 2 branches and 3 members at h = 0.141] | | |--leaf "18" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.141] | | |--leaf "16" | | `--leaf "17" | `--[dendrogram w/ 2 branches and 2 members at h = 0.412] | |--leaf "20" | `--leaf "21" `--[dendrogram w/ 2 branches and 22 members at h = 1.76] |--[dendrogram w/ 2 branches and 8 members at h = 0.781] | |--[dendrogram w/ 2 branches and 5 members at h = 0.245] | | |--leaf "8" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.224] | | |--leaf "4" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.141] | | |--leaf "7" | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | |--leaf "5" | | `--leaf "6" | `--[dendrogram w/ 2 branches and 3 members at h = 0.412] | |--leaf "9" | `--[dendrogram w/ 2 branches and 2 members at h = 0.173] | |--leaf "10" | `--leaf "11" `--[dendrogram w/ 2 branches and 14 members at h = 1.12] |--[dendrogram w/ 2 branches and 7 members at h = 0.616] | |--[dendrogram w/ 2 branches and 4 members at h = 0.332] | | |--leaf "91" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.173] | | |--leaf "30" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.1] | | |--leaf "28" | | `--leaf "29" | `--[dendrogram w/ 2 branches and 3 members at h = 0.374] | |--leaf "92" | `--[dendrogram w/ 2 branches and 2 members at h = 0.1] | |--leaf "22" | `--leaf "23" `--[dendrogram w/ 2 branches and 7 members at h = 0.64] |--leaf "1" `--[dendrogram w/ 2 branches and 6 members at h = 0.51] |--[dendrogram w/ 2 branches and 2 members at h = 0.245] | |--leaf "2" | `--leaf "3" `--[dendrogram w/ 2 branches and 4 members at h = 0.332] |--leaf "24" `--[dendrogram w/ 2 branches and 3 members at h = 0.141] |--leaf "27" `--[dendrogram w/ 2 branches and 2 members at h = 0.141] |--leaf "25" `--leaf "26" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/19kyr1226323124.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/2pqrl1226323124.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/3jalu1226323124.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/481n21226323124.tab") + } > > system("convert tmp/19kyr1226323124.ps tmp/19kyr1226323124.png") > system("convert tmp/2pqrl1226323124.ps tmp/2pqrl1226323124.png") convert: unable to open image `tmp/2pqrl1226323124.ps': No such file or directory. convert: missing an image filename `tmp/2pqrl1226323124.png'. > > > proc.time() user system elapsed 0.927 0.214 1.062