R version 2.7.0 (2008-04-22) 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(493,116,377,481,111,370,462,104,358,457,100,357,442,93,349,439,91,348,488,119,369,521,139,381,501,134,368,485,124,361,464,113,351,460,109,351,467,109,358,460,106,354,448,101,347,443,98,345,436,93,343,431,91,340,484,122,362,510,139,370,513,140,373,503,132,371,471,117,354,471,114,357,476,113,363,475,110,364,470,107,363,461,103,358,455,98,357,456,98,357,517,137,380,525,148,378,523,147,376,519,139,380,509,130,379,512,128,384,519,127,392,517,123,394,510,118,392,509,114,396,501,108,392,507,111,396,569,151,419,580,159,421,578,158,420,565,148,418,547,138,410,555,137,418,562,136,426,561,133,428,555,126,430,544,120,424,537,114,423,543,116,427,594,153,441,611,162,449,613,161,452,611,149,462,594,139,455,595,135,461,591,130,461,589,127,463,584,122,462,573,117,456),dim=c(3,64),dimnames=list(c('Totale_werkloosheid','jonger_25','ouder_25'),1:64)) > y <- array(NA,dim=c(3,64),dimnames=list(c('Totale_werkloosheid','jonger_25','ouder_25'),1:64)) > 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 = 'Periode' > xlab = 'Werkloosheid' > main = 'Werkloosheid in België' > #'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 64 members at h = 2273] |--[dendrogram w/ 2 branches and 22 members at h = 354] | |--[dendrogram w/ 2 branches and 10 members at h = 116] | | |--[dendrogram w/ 2 branches and 4 members at h = 29.4] | | | |--leaf "55" | | | `--[dendrogram w/ 2 branches and 3 members at h = 21.5] | | | |--leaf "58" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.74] | | | |--leaf "56" | | | `--leaf "57" | | `--[dendrogram w/ 2 branches and 6 members at h = 31.2] | | |--leaf "64" | | `--[dendrogram w/ 2 branches and 5 members at h = 22.2] | | |--[dendrogram w/ 2 branches and 2 members at h = 7.28] | | | |--leaf "59" | | | `--leaf "60" | | `--[dendrogram w/ 2 branches and 3 members at h = 10.5] | | |--leaf "63" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.12] | | |--leaf "61" | | `--leaf "62" | `--[dendrogram w/ 2 branches and 12 members at h = 125] | |--[dendrogram w/ 2 branches and 4 members at h = 26.5] | | |--[dendrogram w/ 2 branches and 2 members at h = 2.45] | | | |--leaf "44" | | | `--leaf "45" | | `--[dendrogram w/ 2 branches and 2 members at h = 5.1] | | |--leaf "43" | | `--leaf "46" | `--[dendrogram w/ 2 branches and 8 members at h = 61.9] | |--[dendrogram w/ 2 branches and 3 members at h = 9.47] | | |--leaf "53" | | `--[dendrogram w/ 2 branches and 2 members at h = 5.1] | | |--leaf "52" | | `--leaf "54" | `--[dendrogram w/ 2 branches and 5 members at h = 30] | |--[dendrogram w/ 2 branches and 2 members at h = 11.4] | | |--leaf "47" | | `--leaf "48" | `--[dendrogram w/ 2 branches and 3 members at h = 13.6] | |--leaf "51" | `--[dendrogram w/ 2 branches and 2 members at h = 3.74] | |--leaf "49" | `--leaf "50" `--[dendrogram w/ 2 branches and 42 members at h = 821] |--[dendrogram w/ 2 branches and 17 members at h = 127] | |--[dendrogram w/ 2 branches and 8 members at h = 46.7] | | |--[dendrogram w/ 2 branches and 4 members at h = 13.0] | | | |--leaf "41" | | | `--[dendrogram w/ 2 branches and 3 members at h = 8.36] | | | |--leaf "39" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.61] | | | |--leaf "40" | | | `--leaf "42" | | `--[dendrogram w/ 2 branches and 4 members at h = 23.5] | | |--[dendrogram w/ 2 branches and 2 members at h = 4.9] | | | |--leaf "37" | | | `--leaf "38" | | `--[dendrogram w/ 2 branches and 2 members at h = 6.16] | | |--leaf "35" | | `--leaf "36" | `--[dendrogram w/ 2 branches and 9 members at h = 52.4] | |--[dendrogram w/ 2 branches and 4 members at h = 19.6] | | |--[dendrogram w/ 2 branches and 2 members at h = 4.12] | | | |--leaf "9" | | | `--leaf "22" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.36] | | |--leaf "20" | | `--leaf "21" | `--[dendrogram w/ 2 branches and 5 members at h = 22.4] | |--[dendrogram w/ 2 branches and 2 members at h = 3] | | |--leaf "32" | | `--leaf "33" | `--[dendrogram w/ 2 branches and 3 members at h = 4.20] | |--leaf "31" | `--[dendrogram w/ 2 branches and 2 members at h = 2.24] | |--leaf "8" | `--leaf "34" `--[dendrogram w/ 2 branches and 25 members at h = 239] |--[dendrogram w/ 2 branches and 11 members at h = 57.9] | |--[dendrogram w/ 2 branches and 4 members at h = 22.1] | | |--[dendrogram w/ 2 branches and 2 members at h = 2.45] | | | |--leaf "10" | | | `--leaf "19" | | `--[dendrogram w/ 2 branches and 2 members at h = 9.9] | | |--leaf "1" | | `--leaf "7" | `--[dendrogram w/ 2 branches and 7 members at h = 22.9] | |--[dendrogram w/ 2 branches and 3 members at h = 10.5] | | |--leaf "2" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.32] | | |--leaf "25" | | `--leaf "26" | `--[dendrogram w/ 2 branches and 4 members at h = 14.3] | |--[dendrogram w/ 2 branches and 2 members at h = 4.24] | | |--leaf "23" | | `--leaf "24" | `--[dendrogram w/ 2 branches and 2 members at h = 6.16] | |--leaf "13" | `--leaf "27" `--[dendrogram w/ 2 branches and 14 members at h = 115] |--[dendrogram w/ 2 branches and 6 members at h = 21.0] | |--[dendrogram w/ 2 branches and 2 members at h = 6.16] | | |--leaf "17" | | `--leaf "18" | `--[dendrogram w/ 2 branches and 4 members at h = 14.4] | |--[dendrogram w/ 2 branches and 2 members at h = 3.74] | | |--leaf "5" | | `--leaf "6" | `--[dendrogram w/ 2 branches and 2 members at h = 6.16] | |--leaf "15" | `--leaf "16" `--[dendrogram w/ 2 branches and 8 members at h = 27] |--[dendrogram w/ 2 branches and 3 members at h = 3.04] | |--leaf "4" | `--[dendrogram w/ 2 branches and 2 members at h = 1] | |--leaf "29" | `--leaf "30" `--[dendrogram w/ 2 branches and 5 members at h = 15.1] |--[dendrogram w/ 2 branches and 2 members at h = 1.41] | |--leaf "3" | `--leaf "28" `--[dendrogram w/ 2 branches and 3 members at h = 8.09] |--leaf "11" `--[dendrogram w/ 2 branches and 2 members at h = 4.24] |--leaf "12" `--leaf "14" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/14mcp1226601624.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/24eki1226601624.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/3jnn21226601624.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/4qc5t1226601624.tab") + } > > system("convert tmp/14mcp1226601624.ps tmp/14mcp1226601624.png") > system("convert tmp/24eki1226601624.ps tmp/24eki1226601624.png") convert: unable to open image `tmp/24eki1226601624.ps': No such file or directory. convert: missing an image filename `tmp/24eki1226601624.png'. > > > proc.time() user system elapsed 1.525 0.301 1.612