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 + ,567 + ,112 + ,455 + ,569 + ,113 + ,456 + ,621 + ,149 + ,472 + ,629 + ,157 + ,472 + ,628 + ,157 + ,471 + ,612 + ,147 + ,465 + ,595 + ,137 + ,459 + ,597 + ,132 + ,465 + ,593 + ,125 + ,468 + ,590 + ,123 + ,467 + ,580 + ,117 + ,463 + ,574 + ,114 + ,460 + ,573 + ,111 + ,462 + ,573 + ,112 + ,461 + ,620 + ,144 + ,476 + ,626 + ,150 + ,476 + ,620 + ,149 + ,471 + ,588 + ,134 + ,453 + ,566 + ,123 + ,443 + ,557 + ,116 + ,442 + ,561 + ,117 + ,444 + ,549 + ,111 + ,438 + ,532 + ,105 + ,427 + ,526 + ,102 + ,424 + ,511 + ,95 + ,416 + ,499 + ,93 + ,406 + ,555 + ,124 + ,431 + ,565 + ,130 + ,434 + ,542 + ,124 + ,418 + ,527 + ,115 + ,412 + ,510 + ,106 + ,404 + ,514 + ,105 + ,409 + ,517 + ,105 + ,412 + ,508 + ,101 + ,406 + ,493 + ,95 + ,398 + ,490 + ,93 + ,397 + ,469 + ,84 + ,385 + ,478 + ,87 + ,390 + ,528 + ,116 + ,413 + ,534 + ,120 + ,413 + ,518 + ,117 + ,401 + ,506 + ,109 + ,397) + ,dim=c(3 + ,106) + ,dimnames=list(c('Totale_werkloosheid' + ,'jonger_25' + ,'ouder_25') + ,1:106)) > y <- array(NA,dim=c(3,106),dimnames=list(c('Totale_werkloosheid','jonger_25','ouder_25'),1:106)) > 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 = 'Werklooshied' > 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 106 members at h = 3011] |--[dendrogram w/ 2 branches and 28 members at h = 386] | |--[dendrogram w/ 2 branches and 11 members at h = 87.6] | | |--[dendrogram w/ 2 branches and 3 members at h = 28.2] | | | |--leaf "55" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.74] | | | |--leaf "56" | | | `--leaf "57" | | `--[dendrogram w/ 2 branches and 8 members at h = 36.5] | | |--[dendrogram w/ 2 branches and 2 members at h = 3.74] | | | |--leaf "58" | | | `--leaf "70" | | `--[dendrogram w/ 2 branches and 6 members at h = 24.5] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.41] | | | |--leaf "68" | | | `--leaf "69" | | `--[dendrogram w/ 2 branches and 4 members at h = 9] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.41] | | | |--leaf "67" | | | `--leaf "81" | | `--[dendrogram w/ 2 branches and 2 members at h = 8.49] | | |--leaf "79" | | `--leaf "80" | `--[dendrogram w/ 2 branches and 17 members at h = 138] | |--[dendrogram w/ 2 branches and 6 members at h = 14.7] | | |--[dendrogram w/ 2 branches and 3 members at h = 3.66] | | | |--leaf "76" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.41] | | | |--leaf "77" | | | `--leaf "78" | | `--[dendrogram w/ 2 branches and 3 members at h = 8.2] | | |--leaf "64" | | `--[dendrogram w/ 2 branches and 2 members at h = 2.45] | | |--leaf "65" | | `--leaf "66" | `--[dendrogram w/ 2 branches and 11 members at h = 42] | |--[dendrogram w/ 2 branches and 4 members at h = 11.8] | | |--leaf "82" | | `--[dendrogram w/ 2 branches and 3 members at h = 6.97] | | |--leaf "59" | | `--[dendrogram w/ 2 branches and 2 members at h = 2.83] | | |--leaf "60" | | `--leaf "71" | `--[dendrogram w/ 2 branches and 7 members at h = 25.4] | |--[dendrogram w/ 2 branches and 2 members at h = 6.48] | | |--leaf "63" | | `--leaf "75" | `--[dendrogram w/ 2 branches and 5 members at h = 12.4] | |--[dendrogram w/ 2 branches and 2 members at h = 3.74] | | |--leaf "73" | | `--leaf "74" | `--[dendrogram w/ 2 branches and 3 members at h = 10.0] | |--leaf "72" | `--[dendrogram w/ 2 branches and 2 members at h = 4.12] | |--leaf "61" | `--leaf "62" `--[dendrogram w/ 2 branches and 78 members at h = 1735] |--[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" `--[dendrogram w/ 2 branches and 53 members at h = 858] |--[dendrogram w/ 2 branches and 24 members at h = 217] | |--[dendrogram w/ 2 branches and 9 members at h = 40.7] | | |--[dendrogram w/ 2 branches and 4 members at h = 12.3] | | | |--leaf "93" | | | `--[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 = 37.2] | | |--[dendrogram w/ 2 branches and 2 members at h = 7.35] | | | |--leaf "87" | | | `--leaf "88" | | `--[dendrogram w/ 2 branches and 3 members at h = 10] | | |--leaf "104" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.73] | | |--leaf "94" | | `--leaf "103" | `--[dendrogram w/ 2 branches and 15 members at h = 133] | |--[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 11 members at h = 70.5] | |--[dendrogram w/ 2 branches and 4 members at h = 19.2] | | |--leaf "86" | | `--[dendrogram w/ 2 branches and 3 members at h = 11.4] | | |--leaf "83" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.58] | | |--leaf "84" | | `--leaf "85" | `--[dendrogram w/ 2 branches and 7 members at h = 39.6] | |--[dendrogram w/ 2 branches and 2 members at h = 11.4] | | |--leaf "47" | | `--leaf "48" | `--[dendrogram w/ 2 branches and 5 members at h = 21.5] | |--[dendrogram w/ 2 branches and 2 members at h = 2.24] | | |--leaf "51" | | `--leaf "91" | `--[dendrogram w/ 2 branches and 3 members at h = 10.9] | |--leaf "92" | `--[dendrogram w/ 2 branches and 2 members at h = 3.74] | |--leaf "49" | `--leaf "50" `--[dendrogram w/ 2 branches and 29 members at h = 350] |--[dendrogram w/ 2 branches and 11 members at h = 53.6] | |--[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 6 members at h = 26.6] | |--[dendrogram w/ 2 branches and 2 members at h = 6.16] | | |--leaf "35" | | `--leaf "36" | `--[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 18 members at h = 145] |--[dendrogram w/ 2 branches and 5 members at h = 48] | |--[dendrogram w/ 2 branches and 2 members at h = 10.7] | | |--leaf "101" | | `--leaf "102" | `--[dendrogram w/ 2 branches and 3 members at h = 14.0] | |--leaf "90" | `--[dendrogram w/ 2 branches and 2 members at h = 3.74] | |--leaf "99" | `--leaf "100" `--[dendrogram w/ 2 branches and 13 members at h = 74.7] |--[dendrogram w/ 2 branches and 5 members at h = 16.7] | |--leaf "89" | `--[dendrogram w/ 2 branches and 4 members at h = 13.3] | |--[dendrogram w/ 2 branches and 2 members at h = 4.24] | | |--leaf "96" | | `--leaf "97" | `--[dendrogram w/ 2 branches and 2 members at h = 5.74] | |--leaf "95" | `--leaf "98" `--[dendrogram w/ 2 branches and 8 members at h = 39.1] |--[dendrogram w/ 2 branches and 5 members at h = 11.9] | |--leaf "41" | `--[dendrogram w/ 2 branches and 4 members at h = 10.7] | |--leaf "39" | `--[dendrogram w/ 2 branches and 3 members at h = 5.53] | |--leaf "40" | `--[dendrogram w/ 2 branches and 2 members at h = 2.45] | |--leaf "42" | `--leaf "106" `--[dendrogram w/ 2 branches and 3 members at h = 13.5] |--leaf "105" `--[dendrogram w/ 2 branches and 2 members at h = 4.9] |--leaf "37" `--leaf "38" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1z1cy1226598870.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/2gwnj1226598870.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/311051226598870.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/4yhzr1226598870.tab") + } > > system("convert tmp/1z1cy1226598870.ps tmp/1z1cy1226598870.png") > system("convert tmp/2gwnj1226598870.ps tmp/2gwnj1226598870.png") convert: unable to open image `tmp/2gwnj1226598870.ps': No such file or directory. convert: missing an image filename `tmp/2gwnj1226598870.png'. > > > proc.time() user system elapsed 1.848 0.321 1.942