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(577992 + ,308347 + ,121148 + ,143119 + ,565464 + ,298427 + ,114624 + ,140353 + ,547344 + ,289231 + ,109822 + ,137149 + ,554788 + ,291975 + ,112081 + ,138301 + ,562325 + ,294912 + ,113534 + ,138709 + ,560854 + ,293488 + ,112110 + ,138619 + ,555332 + ,290555 + ,109826 + ,137528 + ,543599 + ,284736 + ,107423 + ,134523 + ,536662 + ,281818 + ,105540 + ,133593 + ,542722 + ,287854 + ,108573 + ,135647 + ,593530 + ,316263 + ,128591 + ,143541 + ,610763 + ,325412 + ,139145 + ,144024 + ,612613 + ,326011 + ,129700 + ,148607 + ,611324 + ,328282 + ,132828 + ,148881 + ,594167 + ,317480 + ,126868 + ,145447 + ,595454 + ,317539 + ,128390 + ,144170 + ,590865 + ,313737 + ,126830 + ,142148 + ,589379 + ,312276 + ,124105 + ,142492 + ,584428 + ,309391 + ,122323 + ,141703 + ,573100 + ,302950 + ,119296 + ,139116 + ,567456 + ,300316 + ,116822 + ,138461 + ,569028 + ,304035 + ,119224 + ,139870 + ,620735 + ,333476 + ,139357 + ,148703 + ,628884 + ,337698 + ,144322 + ,150034 + ,628232 + ,335932 + ,133676 + ,153670 + ,612117 + ,323931 + ,128283 + ,147508 + ,595404 + ,313927 + ,121640 + ,145150 + ,597141 + ,314485 + ,122877 + ,143955 + ,593408 + ,313218 + ,117284 + ,147608 + ,590072 + ,309664 + ,116463 + ,144839 + ,579799 + ,302963 + ,112685 + ,142096 + ,574205 + ,298989 + ,113235 + ,138941 + ,572775 + ,298423 + ,111692 + ,139093 + ,572942 + ,301631 + ,113152 + ,141526 + ,619567 + ,329765 + ,129889 + ,151492 + ,625809 + ,335083 + ,131153 + ,155217 + ,619916 + ,327616 + ,123770 + ,154530 + ,587625 + ,309119 + ,112516 + ,148533 + ,565742 + ,295916 + ,105940 + ,143923 + ,557274 + ,291413 + ,104320 + ,141075 + ,560576 + ,291542 + ,103582 + ,142261 + ,548854 + ,284678 + ,99064 + ,140435 + ,531673 + ,276475 + ,94989 + ,136169 + ,525919 + ,272566 + ,92241 + ,136107 + ,511038 + ,264981 + ,89752 + ,131063 + ,498662 + ,263290 + ,90610 + ,127765 + ,555362 + ,296806 + ,109456 + ,140731 + ,564591 + ,303598 + ,110213 + ,145981 + ,541657 + ,286994 + ,97694 + ,141834 + ,527070 + ,276427 + ,91844 + ,137625 + ,509846 + ,266424 + ,87572 + ,132515 + ,514258 + ,267153 + ,89812 + ,131111 + ,516922 + ,268381 + ,89050 + ,133603 + ,507561 + ,262522 + ,85990 + ,132207 + ,492622 + ,255542 + ,85070 + ,126488 + ,490243 + ,253158 + ,83277 + ,125933 + ,469357 + ,243803 + ,79586 + ,120927 + ,477580 + ,250741 + ,84215 + ,122597 + ,528379 + ,280445 + ,99708 + ,135437 + ,533590 + ,285257 + ,100698 + ,138649 + ,517945 + ,270976 + ,90861 + ,134576) + ,dim=c(4 + ,61) + ,dimnames=list(c('Belgiƫ' + ,'Vrouw' + ,'VrouwVlaams' + ,'VrouwWaals') + ,1:61)) > y <- array(NA,dim=c(4,61),dimnames=list(c('Belgiƫ','Vrouw','VrouwVlaams','VrouwWaals'),1:61)) > 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 61 members at h = 1356372] |--[dendrogram w/ 2 branches and 22 members at h = 270139] | |--[dendrogram w/ 2 branches and 12 members at h = 40048] | | |--[dendrogram w/ 2 branches and 7 members at h = 12926] | | | |--[dendrogram w/ 2 branches and 3 members at h = 2754] | | | | |--leaf "11" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 2368] | | | | |--leaf "15" | | | | `--leaf "16" | | | `--[dendrogram w/ 2 branches and 4 members at h = 12377] | | | |--[dendrogram w/ 2 branches and 2 members at h = 2507] | | | | |--leaf "27" | | | | `--leaf "28" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3448] | | | |--leaf "17" | | | `--leaf "18" | | `--[dendrogram w/ 2 branches and 5 members at h = 21731] | | |--[dendrogram w/ 2 branches and 2 members at h = 6775] | | | |--leaf "1" | | | `--leaf "19" | | `--[dendrogram w/ 2 branches and 3 members at h = 7813] | | |--leaf "38" | | `--[dendrogram w/ 2 branches and 2 members at h = 5666] | | |--leaf "29" | | `--leaf "30" | `--[dendrogram w/ 2 branches and 10 members at h = 48060] | |--[dendrogram w/ 2 branches and 4 members at h = 17176] | | |--[dendrogram w/ 2 branches and 2 members at h = 3918] | | | |--leaf "25" | | | `--leaf "36" | | `--[dendrogram w/ 2 branches and 2 members at h = 10519] | | |--leaf "23" | | `--leaf "24" | `--[dendrogram w/ 2 branches and 6 members at h = 21636] | |--[dendrogram w/ 2 branches and 2 members at h = 7170] | | |--leaf "35" | | `--leaf "37" | `--[dendrogram w/ 2 branches and 4 members at h = 13146] | |--leaf "12" | `--[dendrogram w/ 2 branches and 3 members at h = 6118] | |--leaf "14" | `--[dendrogram w/ 2 branches and 2 members at h = 2791] | |--leaf "13" | `--leaf "26" `--[dendrogram w/ 2 branches and 39 members at h = 701036] |--[dendrogram w/ 2 branches and 11 members at h = 117614] | |--[dendrogram w/ 2 branches and 6 members at h = 16072] | | |--[dendrogram w/ 2 branches and 2 members at h = 3465] | | | |--leaf "53" | | | `--leaf "61" | | `--[dendrogram w/ 2 branches and 4 members at h = 7779] | | |--leaf "54" | | `--[dendrogram w/ 2 branches and 3 members at h = 4980] | | |--leaf "52" | | `--[dendrogram w/ 2 branches and 2 members at h = 3219] | | |--leaf "45" | | `--leaf "51" | `--[dendrogram w/ 2 branches and 5 members at h = 42371] | |--[dendrogram w/ 2 branches and 2 members at h = 11831] | | |--leaf "57" | | `--leaf "58" | `--[dendrogram w/ 2 branches and 3 members at h = 16407] | |--leaf "46" | `--[dendrogram w/ 2 branches and 2 members at h = 3856] | |--leaf "55" | `--leaf "56" `--[dendrogram w/ 2 branches and 28 members at h = 292190] |--[dendrogram w/ 2 branches and 11 members at h = 64847] | |--[dendrogram w/ 2 branches and 4 members at h = 11115] | | |--[dendrogram w/ 2 branches and 2 members at h = 4324] | | | |--leaf "44" | | | `--leaf "50" | | `--[dendrogram w/ 2 branches and 2 members at h = 7030] | | |--leaf "43" | | `--leaf "59" | `--[dendrogram w/ 2 branches and 7 members at h = 21765] | |--[dendrogram w/ 2 branches and 3 members at h = 6828] | | |--leaf "3" | | `--[dendrogram w/ 2 branches and 2 members at h = 3616] | | |--leaf "8" | | `--leaf "10" | `--[dendrogram w/ 2 branches and 4 members at h = 18873] | |--[dendrogram w/ 2 branches and 2 members at h = 7810] | | |--leaf "42" | | `--leaf "49" | `--[dendrogram w/ 2 branches and 2 members at h = 8383] | |--leaf "9" | `--leaf "60" `--[dendrogram w/ 2 branches and 17 members at h = 76302] |--[dendrogram w/ 2 branches and 8 members at h = 19532] | |--[dendrogram w/ 2 branches and 4 members at h = 10040] | | |--leaf "31" | | `--[dendrogram w/ 2 branches and 3 members at h = 4734] | | |--leaf "34" | | `--[dendrogram w/ 2 branches and 2 members at h = 2184] | | |--leaf "32" | | `--leaf "33" | `--[dendrogram w/ 2 branches and 4 members at h = 10783] | |--[dendrogram w/ 2 branches and 2 members at h = 3993] | | |--leaf "2" | | `--leaf "21" | `--[dendrogram w/ 2 branches and 2 members at h = 4282] | |--leaf "20" | `--leaf "22" `--[dendrogram w/ 2 branches and 9 members at h = 22787] |--[dendrogram w/ 2 branches and 2 members at h = 9101] | |--leaf "39" | `--leaf "48" `--[dendrogram w/ 2 branches and 7 members at h = 17057] |--[dendrogram w/ 2 branches and 2 members at h = 3588] | |--leaf "40" | `--leaf "41" `--[dendrogram w/ 2 branches and 5 members at h = 12717] |--[dendrogram w/ 2 branches and 2 members at h = 2495] | |--leaf "5" | `--leaf "6" `--[dendrogram w/ 2 branches and 3 members at h = 7772] |--leaf "47" `--[dendrogram w/ 2 branches and 2 members at h = 2828] |--leaf "4" `--leaf "7" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1r4w21226436980.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/2kos61226436980.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/309t11226436980.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/4841g1226436980.tab") + } > > system("convert tmp/1r4w21226436980.ps tmp/1r4w21226436980.png") > system("convert tmp/2kos61226436980.ps tmp/2kos61226436980.png") convert: unable to open image `tmp/2kos61226436980.ps': No such file or directory. convert: missing an image filename `tmp/2kos61226436980.png'. > > > proc.time() user system elapsed 1.548 0.307 1.618