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(116222 + ,344744 + ,31899 + ,492865 + ,110924 + ,338653 + ,31384 + ,480961 + ,103753 + ,327532 + ,30650 + ,461935 + ,99983 + ,326225 + ,30400 + ,456608 + ,93302 + ,318672 + ,30003 + ,441977 + ,91496 + ,317756 + ,29896 + ,439148 + ,119321 + ,337302 + ,31557 + ,488180 + ,139261 + ,349420 + ,31883 + ,520564 + ,133739 + ,336923 + ,30830 + ,501492 + ,123913 + ,330758 + ,30354 + ,485025 + ,113438 + ,321002 + ,29756 + ,464196 + ,109416 + ,320820 + ,29934 + ,460170 + ,109406 + ,327032 + ,30599 + ,467037 + ,105645 + ,324047 + ,30378 + ,460070 + ,101328 + ,316735 + ,29925 + ,447988 + ,97686 + ,315710 + ,29471 + ,442867 + ,93093 + ,313427 + ,29567 + ,436087 + ,91382 + ,310527 + ,29419 + ,431328 + ,122257 + ,330962 + ,30796 + ,484015 + ,139183 + ,339015 + ,31475 + ,509673 + ,139887 + ,341332 + ,31708 + ,512927 + ,131822 + ,339092 + ,31917 + ,502831 + ,116805 + ,323308 + ,30871 + ,470984 + ,113706 + ,325849 + ,31512 + ,471067 + ,113012 + ,330675 + ,32362 + ,476049 + ,110452 + ,332225 + ,31928 + ,474605 + ,107005 + ,331735 + ,31699 + ,470439 + ,102841 + ,328047 + ,30363 + ,461251 + ,98173 + ,326165 + ,30386 + ,454724 + ,98181 + ,327081 + ,30364 + ,455626 + ,137277 + ,346764 + ,32806 + ,516847 + ,147579 + ,344190 + ,33423 + ,525192 + ,146571 + ,343333 + ,33071 + ,522975 + ,138920 + ,345777 + ,33888 + ,518585 + ,130340 + ,344094 + ,34805 + ,509239 + ,128140 + ,348609 + ,35489 + ,512238 + ,127059 + ,354846 + ,37259 + ,519164 + ,122860 + ,356427 + ,37722 + ,517009 + ,117702 + ,353467 + ,38764 + ,509933 + ,113537 + ,355996 + ,39594 + ,509127 + ,108366 + ,352487 + ,40004 + ,500857 + ,111078 + ,355178 + ,40715 + ,506971 + ,150739 + ,374556 + ,44028 + ,569323 + ,159129 + ,375021 + ,45564 + ,579714 + ,157928 + ,375787 + ,44277 + ,577992 + ,147768 + ,372720 + ,44976 + ,565464 + ,137507 + ,364431 + ,45406 + ,547344 + ,136919 + ,370490 + ,47379 + ,554788 + ,136151 + ,376974 + ,49200 + ,562325 + ,133001 + ,377632 + ,50221 + ,560854 + ,125554 + ,378205 + ,51573 + ,555332 + ,119647 + ,370861 + ,53091 + ,543599 + ,114158 + ,369167 + ,53337 + ,536662 + ,116193 + ,371551 + ,54978 + ,542722 + ,152803 + ,382842 + ,57885 + ,593530 + ,161761 + ,381903 + ,67099 + ,610763 + ,160942 + ,384502 + ,67169 + ,612613 + ,149470 + ,392058 + ,69796 + ,611324 + ,139208 + ,384359 + ,70600 + ,594167 + ,134588 + ,388884 + ,71982 + ,595454 + ,130322 + ,386586 + ,73957 + ,590865 + ,126611 + ,387495 + ,75273 + ,589379 + ,122401 + ,385705 + ,76322 + ,584428 + ,117352 + ,378670 + ,77078 + ,573100 + ,112135 + ,377367 + ,77954 + ,567456 + ,112879 + ,376911 + ,79238 + ,569028 + ,148729 + ,389827 + ,82179 + ,620735 + ,157230 + ,387820 + ,83834 + ,628884 + ,157221 + ,387267 + ,83744 + ,628232 + ,146681 + ,380575 + ,84861 + ,612117 + ,136524 + ,372402 + ,86478 + ,595404 + ,132111 + ,376740 + ,88290 + ,597141 + ,125326 + ,377795 + ,90287 + ,593408 + ,122716 + ,376126 + ,91230 + ,590072 + ,116615 + ,370804 + ,92380 + ,579799 + ,113719 + ,367980 + ,92506 + ,574205 + ,110737 + ,367866 + ,94172 + ,572775 + ,112093 + ,366121 + ,94728 + ,572942 + ,143565 + ,379421 + ,96581 + ,619567 + ,149946 + ,378519 + ,97344 + ,625809 + ,149147 + ,372423 + ,98346 + ,619916 + ,134339 + ,355072 + ,98214 + ,587625 + ,122683 + ,344693 + ,98366 + ,565742 + ,115614 + ,342892 + ,98768 + ,557274 + ,116566 + ,344178 + ,99832 + ,560576 + ,111272 + ,337606 + ,99976 + ,548854 + ,104609 + ,327103 + ,99961 + ,531673 + ,101802 + ,323953 + ,100164 + ,525919 + ,94542 + ,316532 + ,99964 + ,511038 + ,93051 + ,306307 + ,99304 + ,498662 + ,124129 + ,327225 + ,104008 + ,555362 + ,130374 + ,329573 + ,104644 + ,564591 + ,123946 + ,313761 + ,103950 + ,541657 + ,114971 + ,307836 + ,104263 + ,527070 + ,105531 + ,300074 + ,104241 + ,509846 + ,104919 + ,304198 + ,105141 + ,514258 + ,104782 + ,306122 + ,106018 + ,516922 + ,101281 + ,300414 + ,105866 + ,507561 + ,94545 + ,292133 + ,105944 + ,492622 + ,93248 + ,290616 + ,106379 + ,490243 + ,84031 + ,280244 + ,105082 + ,469357 + ,87486 + ,285179 + ,104915 + ,477580 + ,115867 + ,305486 + ,107026 + ,528379 + ,120327 + ,305957 + ,107306 + ,533590) + ,dim=c(4 + ,104) + ,dimnames=list(c('tot25' + ,'25-50' + ,'50+' + ,'totaal') + ,1:104)) > y <- array(NA,dim=c(4,104),dimnames=list(c('tot25','25-50','50+','totaal'),1:104)) > 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 104 members at h = 3205469] |--[dendrogram w/ 2 branches and 46 members at h = 516394] | |--[dendrogram w/ 2 branches and 11 members at h = 79848] | | |--[dendrogram w/ 2 branches and 3 members at h = 28440] | | | |--leaf "55" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3294] | | | |--leaf "56" | | | `--leaf "57" | | `--[dendrogram w/ 2 branches and 8 members at h = 50248] | | |--[dendrogram w/ 2 branches and 3 members at h = 9232] | | | |--leaf "79" | | | `--[dendrogram w/ 2 branches and 2 members at h = 8575] | | | |--leaf "80" | | | `--leaf "81" | | `--[dendrogram w/ 2 branches and 5 members at h = 31972] | | |--[dendrogram w/ 2 branches and 2 members at h = 860] | | | |--leaf "68" | | | `--leaf "69" | | `--[dendrogram w/ 2 branches and 3 members at h = 18900] | | |--leaf "58" | | `--[dendrogram w/ 2 branches and 2 members at h = 13087] | | |--leaf "67" | | `--leaf "70" | `--[dendrogram w/ 2 branches and 35 members at h = 439380] | |--[dendrogram w/ 2 branches and 12 members at h = 126918] | | |--[dendrogram w/ 2 branches and 4 members at h = 25863] | | | |--[dendrogram w/ 2 branches and 2 members at h = 2579] | | | | |--leaf "44" | | | | `--leaf "45" | | | `--[dendrogram w/ 2 branches and 2 members at h = 5290] | | | |--leaf "43" | | | `--leaf "46" | | `--[dendrogram w/ 2 branches and 8 members at h = 65954] | | |--[dendrogram w/ 2 branches and 3 members at h = 9321] | | | |--leaf "53" | | | `--[dendrogram w/ 2 branches and 2 members at h = 4091] | | | |--leaf "52" | | | `--leaf "54" | | `--[dendrogram w/ 2 branches and 5 members at h = 25507] | | |--[dendrogram w/ 2 branches and 2 members at h = 9816] | | | |--leaf "47" | | | `--leaf "48" | | `--[dendrogram w/ 2 branches and 3 members at h = 13680] | | |--leaf "51" | | `--[dendrogram w/ 2 branches and 2 members at h = 3683] | | |--leaf "49" | | `--leaf "50" | `--[dendrogram w/ 2 branches and 23 members at h = 296053] | |--[dendrogram w/ 2 branches and 6 members at h = 35823] | | |--[dendrogram w/ 2 branches and 2 members at h = 11406] | | | |--leaf "91" | | | `--leaf "92" | | `--[dendrogram w/ 2 branches and 4 members at h = 19639] | | |--leaf "86" | | `--[dendrogram w/ 2 branches and 3 members at h = 11620] | | |--leaf "83" | | `--[dendrogram w/ 2 branches and 2 members at h = 3820] | | |--leaf "84" | | `--leaf "85" | `--[dendrogram w/ 2 branches and 17 members at h = 135616] | |--[dendrogram w/ 2 branches and 7 members at h = 52635] | | |--[dendrogram w/ 2 branches and 3 members at h = 8933] | | | |--leaf "64" | | | `--[dendrogram w/ 2 branches and 2 members at h = 2209] | | | |--leaf "65" | | | `--leaf "66" | | `--[dendrogram w/ 2 branches and 4 members at h = 11625] | | |--leaf "75" | | `--[dendrogram w/ 2 branches and 3 members at h = 4078] | | |--leaf "76" | | `--[dendrogram w/ 2 branches and 2 members at h = 2285] | | |--leaf "77" | | `--leaf "78" | `--[dendrogram w/ 2 branches and 10 members at h = 73134] | |--[dendrogram w/ 2 branches and 5 members at h = 22225] | | |--[dendrogram w/ 2 branches and 2 members at h = 6737] | | | |--leaf "59" | | | `--leaf "60" | | `--[dendrogram w/ 2 branches and 3 members at h = 10122] | | |--leaf "63" | | `--[dendrogram w/ 2 branches and 2 members at h = 4306] | | |--leaf "61" | | `--leaf "62" | `--[dendrogram w/ 2 branches and 5 members at h = 33812] | |--leaf "82" | `--[dendrogram w/ 2 branches and 4 members at h = 19006] | |--[dendrogram w/ 2 branches and 2 members at h = 4649] | | |--leaf "73" | | `--leaf "74" | `--[dendrogram w/ 2 branches and 2 members at h = 6678] | |--leaf "71" | `--leaf "72" `--[dendrogram w/ 2 branches and 58 members at h = 1330765] |--[dendrogram w/ 2 branches and 16 members at h = 190527] | |--[dendrogram w/ 2 branches and 4 members at h = 36502] | | |--[dendrogram w/ 2 branches and 2 members at h = 3136] | | | |--leaf "99" | | | `--leaf "100" | | `--[dendrogram w/ 2 branches and 2 members at h = 10195] | | |--leaf "101" | | `--leaf "102" | `--[dendrogram w/ 2 branches and 12 members at h = 98011] | |--[dendrogram w/ 2 branches and 6 members at h = 31863] | | |--[dendrogram w/ 2 branches and 4 members at h = 13593] | | | |--[dendrogram w/ 2 branches and 2 members at h = 3404] | | | | |--leaf "96" | | | | `--leaf "97" | | | `--[dendrogram w/ 2 branches and 2 members at h = 5103] | | | |--leaf "95" | | | `--leaf "98" | | `--[dendrogram w/ 2 branches and 2 members at h = 16136] | | |--leaf "89" | | `--leaf "90" | `--[dendrogram w/ 2 branches and 6 members at h = 51970] | |--[dendrogram w/ 2 branches and 2 members at h = 7138] | | |--leaf "87" | | `--leaf "88" | `--[dendrogram w/ 2 branches and 4 members at h = 20797] | |--leaf "93" | `--[dendrogram w/ 2 branches and 3 members at h = 9377] | |--leaf "104" | `--[dendrogram w/ 2 branches and 2 members at h = 3959] | |--leaf "94" | `--leaf "103" `--[dendrogram w/ 2 branches and 42 members at h = 798427] |--[dendrogram w/ 2 branches and 17 members at h = 109913] | |--[dendrogram w/ 2 branches and 4 members at h = 12656] | | |--leaf "41" | | `--[dendrogram w/ 2 branches and 3 members at h = 7292] | | |--leaf "39" | | `--[dendrogram w/ 2 branches and 2 members at h = 3553] | | |--leaf "40" | | `--leaf "42" | `--[dendrogram w/ 2 branches and 13 members at h = 54266] | |--[dendrogram w/ 2 branches and 7 members at h = 25520] | | |--[dendrogram w/ 2 branches and 2 members at h = 2606] | | | |--leaf "32" | | | `--leaf "33" | | `--[dendrogram w/ 2 branches and 5 members at h = 19562] | | |--[dendrogram w/ 2 branches and 2 members at h = 4063] | | | |--leaf "20" | | | `--leaf "21" | | `--[dendrogram w/ 2 branches and 3 members at h = 5521] | | |--leaf "8" | | `--[dendrogram w/ 2 branches and 2 members at h = 2804] | | |--leaf "31" | | `--leaf "34" | `--[dendrogram w/ 2 branches and 6 members at h = 39179] | |--[dendrogram w/ 2 branches and 2 members at h = 3370] | | |--leaf "9" | | `--leaf "22" | `--[dendrogram w/ 2 branches and 4 members at h = 20651] | |--[dendrogram w/ 2 branches and 2 members at h = 4999] | | |--leaf "37" | | `--leaf "38" | `--[dendrogram w/ 2 branches and 2 members at h = 5890] | |--leaf "35" | `--leaf "36" `--[dendrogram w/ 2 branches and 25 members at h = 236238] |--[dendrogram w/ 2 branches and 11 members at h = 59764] | |--[dendrogram w/ 2 branches and 4 members at h = 20429] | | |--[dendrogram w/ 2 branches and 2 members at h = 2000] | | | |--leaf "10" | | | `--leaf "19" | | `--[dendrogram w/ 2 branches and 2 members at h = 9330] | | |--leaf "1" | | `--leaf "7" | `--[dendrogram w/ 2 branches and 7 members at h = 20559] | |--[dendrogram w/ 2 branches and 3 members at h = 11361] | | |--leaf "2" | | `--[dendrogram w/ 2 branches and 2 members at h = 3351] | | |--leaf "25" | | `--leaf "26" | `--[dendrogram w/ 2 branches and 4 members at h = 13365] | |--[dendrogram w/ 2 branches and 2 members at h = 4059] | | |--leaf "23" | | `--leaf "24" | `--[dendrogram w/ 2 branches and 2 members at h = 6377] | |--leaf "13" | `--leaf "27" `--[dendrogram w/ 2 branches and 14 members at h = 113040] |--[dendrogram w/ 2 branches and 6 members at h = 20247] | |--[dendrogram w/ 2 branches and 2 members at h = 5832] | | |--leaf "17" | | `--leaf "18" | `--[dendrogram w/ 2 branches and 4 members at h = 13260] | |--[dendrogram w/ 2 branches and 2 members at h = 3481] | | |--leaf "5" | | `--leaf "6" | `--[dendrogram w/ 2 branches and 2 members at h = 6383] | |--leaf "15" | `--leaf "16" `--[dendrogram w/ 2 branches and 8 members at h = 27150] |--[dendrogram w/ 2 branches and 3 members at h = 2796] | |--leaf "4" | `--[dendrogram w/ 2 branches and 2 members at h = 1286] | |--leaf "29" | `--leaf "30" `--[dendrogram w/ 2 branches and 5 members at h = 15188] |--[dendrogram w/ 2 branches and 2 members at h = 1283] | |--leaf "3" | `--leaf "28" `--[dendrogram w/ 2 branches and 3 members at h = 8369] |--leaf "11" `--[dendrogram w/ 2 branches and 2 members at h = 4984] |--leaf "12" `--leaf "14" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/19igy1226515463.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/2ktg61226515463.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/3mwt51226515463.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/4r0i31226515463.tab") + } > > system("convert tmp/19igy1226515463.ps tmp/19igy1226515463.png") > system("convert tmp/2ktg61226515463.ps tmp/2ktg61226515463.png") convert: unable to open image `tmp/2ktg61226515463.ps': No such file or directory. convert: missing an image filename `tmp/2ktg61226515463.png'. > > > proc.time() user system elapsed 1.888 0.330 1.969