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(220206 + ,255843 + ,113012 + ,220115 + ,254490 + ,110452 + ,218444 + ,251995 + ,107005 + ,214912 + ,246339 + ,102841 + ,210705 + ,244019 + ,98173 + ,209673 + ,245953 + ,98181 + ,237041 + ,279806 + ,137277 + ,242081 + ,283111 + ,147579 + ,241878 + ,281097 + ,146571 + ,242621 + ,275964 + ,138920 + ,238545 + ,270694 + ,130340 + ,240337 + ,271901 + ,128140 + ,244752 + ,274412 + ,127059 + ,244576 + ,272433 + ,122860 + ,241572 + ,268361 + ,117702 + ,240541 + ,268586 + ,113537 + ,236089 + ,264768 + ,108366 + ,236997 + ,269974 + ,111078 + ,264579 + ,304744 + ,150739 + ,270349 + ,309365 + ,159129 + ,269645 + ,308347 + ,157928 + ,267037 + ,298427 + ,147768 + ,258113 + ,289231 + ,137507 + ,262813 + ,291975 + ,136919 + ,267413 + ,294912 + ,136151 + ,267366 + ,293488 + ,133001 + ,264777 + ,290555 + ,125554 + ,258863 + ,284736 + ,119647 + ,254844 + ,281818 + ,114158 + ,254868 + ,287854 + ,116193 + ,277267 + ,316263 + ,152803 + ,285351 + ,325412 + ,161761 + ,286602 + ,326011 + ,160942 + ,283042 + ,328282 + ,149470 + ,276687 + ,317480 + ,139208 + ,277915 + ,317539 + ,134588 + ,277128 + ,313737 + ,130322 + ,277103 + ,312276 + ,126611 + ,275037 + ,309391 + ,122401 + ,270150 + ,302950 + ,117352 + ,267140 + ,300316 + ,112135 + ,264993 + ,304035 + ,112879 + ,287259 + ,333476 + ,148729 + ,291186 + ,337698 + ,157230 + ,292300 + ,335932 + ,157221 + ,288186 + ,323931 + ,146681 + ,281477 + ,313927 + ,136524 + ,282656 + ,314485 + ,132111 + ,280190 + ,313218 + ,125326 + ,280408 + ,309664 + ,122716 + ,276836 + ,302963 + ,116615 + ,275216 + ,298989 + ,113719 + ,274352 + ,298423 + ,110737 + ,271311 + ,301631 + ,112093 + ,289802 + ,329765 + ,143565 + ,290726 + ,335083 + ,149946 + ,292300 + ,327616 + ,149147 + ,278506 + ,309119 + ,134339 + ,269826 + ,295916 + ,122683 + ,265861 + ,291413 + ,115614 + ,269034 + ,291542 + ,116566 + ,264176 + ,284678 + ,111272 + ,255198 + ,276475 + ,104609 + ,253353 + ,272566 + ,101802 + ,246057 + ,264981 + ,94542 + ,235372 + ,263290 + ,93051 + ,258556 + ,296806 + ,124129 + ,260993 + ,303598 + ,130374 + ,254663 + ,286994 + ,123946 + ,250643 + ,276427 + ,114971 + ,243422 + ,266424 + ,105531 + ,247105 + ,267153 + ,104919) + ,dim=c(3 + ,72) + ,dimnames=list(c('Werkloze_mannen' + ,'Werkloze_vrouwen' + ,'Werkloze_jonger_dan_25') + ,1:72)) > y <- array(NA,dim=c(3,72),dimnames=list(c('Werkloze_mannen','Werkloze_vrouwen','Werkloze_jonger_dan_25'),1:72)) > 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 72 members at h = 1033866] |--[dendrogram w/ 2 branches and 25 members at h = 205569] | |--[dendrogram w/ 2 branches and 10 members at h = 34292] | | |--[dendrogram w/ 2 branches and 6 members at h = 12932] | | | |--[dendrogram w/ 2 branches and 2 members at h = 4010] | | | | |--leaf "43" | | | | `--leaf "56" | | | `--[dendrogram w/ 2 branches and 4 members at h = 9615] | | | |--leaf "34" | | | `--[dendrogram w/ 2 branches and 3 members at h = 6844] | | | |--leaf "55" | | | `--[dendrogram w/ 2 branches and 2 members at h = 6049] | | | |--leaf "46" | | | `--leaf "57" | | `--[dendrogram w/ 2 branches and 4 members at h = 24580] | | |--[dendrogram w/ 2 branches and 2 members at h = 1611] | | | |--leaf "32" | | | `--leaf "33" | | `--[dendrogram w/ 2 branches and 2 members at h = 2088] | | |--leaf "44" | | `--leaf "45" | `--[dendrogram w/ 2 branches and 15 members at h = 121108] | |--[dendrogram w/ 2 branches and 5 members at h = 24630] | | |--[dendrogram w/ 2 branches and 2 members at h = 7401] | | | |--leaf "19" | | | `--leaf "22" | | `--[dendrogram w/ 2 branches and 3 members at h = 15268] | | |--leaf "31" | | `--[dendrogram w/ 2 branches and 2 members at h = 1725] | | |--leaf "20" | | `--leaf "21" | `--[dendrogram w/ 2 branches and 10 members at h = 31415] | |--[dendrogram w/ 2 branches and 5 members at h = 9695] | | |--[dendrogram w/ 2 branches and 2 members at h = 5387] | | | |--leaf "39" | | | `--leaf "50" | | `--[dendrogram w/ 2 branches and 3 members at h = 5423] | | |--leaf "37" | | `--[dendrogram w/ 2 branches and 2 members at h = 3474] | | |--leaf "38" | | `--leaf "49" | `--[dendrogram w/ 2 branches and 5 members at h = 10850] | |--[dendrogram w/ 2 branches and 2 members at h = 4781] | | |--leaf "35" | | `--leaf "36" | `--[dendrogram w/ 2 branches and 3 members at h = 7266] | |--leaf "58" | `--[dendrogram w/ 2 branches and 2 members at h = 4602] | |--leaf "47" | `--leaf "48" `--[dendrogram w/ 2 branches and 47 members at h = 518327] |--[dendrogram w/ 2 branches and 23 members at h = 103392] | |--[dendrogram w/ 2 branches and 7 members at h = 14576] | | |--[dendrogram w/ 2 branches and 2 members at h = 4358] | | | |--leaf "41" | | | `--leaf "42" | | `--[dendrogram w/ 2 branches and 5 members at h = 9461] | | |--[dendrogram w/ 2 branches and 3 members at h = 5355] | | | |--leaf "54" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3156] | | | |--leaf "52" | | | `--leaf "53" | | `--[dendrogram w/ 2 branches and 2 members at h = 6727] | | |--leaf "40" | | `--leaf "51" | `--[dendrogram w/ 2 branches and 16 members at h = 78253] | |--[dendrogram w/ 2 branches and 8 members at h = 27378] | | |--[dendrogram w/ 2 branches and 4 members at h = 12447] | | | |--[dendrogram w/ 2 branches and 2 members at h = 3457] | | | | |--leaf "25" | | | | `--leaf "26" | | | `--[dendrogram w/ 2 branches and 2 members at h = 5474] | | | |--leaf "23" | | | `--leaf "24" | | `--[dendrogram w/ 2 branches and 4 members at h = 15650] | | |--[dendrogram w/ 2 branches and 2 members at h = 7904] | | | |--leaf "27" | | | `--leaf "59" | | `--[dendrogram w/ 2 branches and 2 members at h = 9543] | | |--leaf "67" | | `--leaf "68" | `--[dendrogram w/ 2 branches and 8 members at h = 32713] | |--[dendrogram w/ 2 branches and 3 members at h = 10979] | | |--leaf "62" | | `--[dendrogram w/ 2 branches and 2 members at h = 3315] | | |--leaf "60" | | `--leaf "61" | `--[dendrogram w/ 2 branches and 5 members at h = 16088] | |--[dendrogram w/ 2 branches and 2 members at h = 6883] | | |--leaf "29" | | `--leaf "70" | `--[dendrogram w/ 2 branches and 3 members at h = 7438] | |--leaf "69" | `--[dendrogram w/ 2 branches and 2 members at h = 6133] | |--leaf "28" | `--leaf "30" `--[dendrogram w/ 2 branches and 24 members at h = 224878] |--[dendrogram w/ 2 branches and 6 members at h = 37066] | |--[dendrogram w/ 2 branches and 3 members at h = 6981] | | |--leaf "3" | | `--[dendrogram w/ 2 branches and 2 members at h = 2897] | | |--leaf "1" | | `--leaf "2" | `--[dendrogram w/ 2 branches and 3 members at h = 8417] | |--leaf "4" | `--[dendrogram w/ 2 branches and 2 members at h = 2192] | |--leaf "5" | `--leaf "6" `--[dendrogram w/ 2 branches and 18 members at h = 170505] |--[dendrogram w/ 2 branches and 10 members at h = 38834] | |--[dendrogram w/ 2 branches and 6 members at h = 19543] | | |--[dendrogram w/ 2 branches and 2 members at h = 3804] | | | |--leaf "71" | | | `--leaf "72" | | `--[dendrogram w/ 2 branches and 4 members at h = 10866] | | |--[dendrogram w/ 2 branches and 2 members at h = 4297] | | | |--leaf "15" | | | `--leaf "16" | | `--[dendrogram w/ 2 branches and 2 members at h = 5940] | | |--leaf "17" | | `--leaf "18" | `--[dendrogram w/ 2 branches and 4 members at h = 31514] | |--[dendrogram w/ 2 branches and 2 members at h = 5154] | | |--leaf "63" | | `--leaf "64" | `--[dendrogram w/ 2 branches and 2 members at h = 10920] | |--leaf "65" | `--leaf "66" `--[dendrogram w/ 2 branches and 8 members at h = 49370] |--[dendrogram w/ 2 branches and 4 members at h = 10983] | |--[dendrogram w/ 2 branches and 2 members at h = 3084] | | |--leaf "11" | | `--leaf "12" | `--[dendrogram w/ 2 branches and 2 members at h = 4645] | |--leaf "13" | `--leaf "14" `--[dendrogram w/ 2 branches and 4 members at h = 16872] |--[dendrogram w/ 2 branches and 2 members at h = 2261] | |--leaf "8" | `--leaf "9" `--[dendrogram w/ 2 branches and 2 members at h = 6971] |--leaf "7" `--leaf "10" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/17o9k1226425136.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/2h45j1226425136.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/37lu71226425136.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/4ngn11226425136.tab") + } > > system("convert tmp/17o9k1226425136.ps tmp/17o9k1226425136.png") > system("convert tmp/2h45j1226425136.ps tmp/2h45j1226425136.png") convert: unable to open image `tmp/2h45j1226425136.ps': No such file or directory. convert: missing an image filename `tmp/2h45j1226425136.png'. > > > proc.time() user system elapsed 0.815 0.209 0.933