R version 2.8.0 (2008-10-20) 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(356.2 + ,152823.6 + ,3 + ,12.9 + ,359.5 + ,123780.5 + ,2.9 + ,13.6 + ,368.4 + ,159987.1 + ,2.9 + ,13.7 + ,371 + ,139603.7 + ,2.8 + ,14.1 + ,397.5 + ,177831.2 + ,2.6 + ,15.2 + ,416.7 + ,173656.9 + ,2.5 + ,15.7 + ,413.2 + ,252392 + ,2.8 + ,13 + ,424.3 + ,228029 + ,2.8 + ,13 + ,415 + ,197300 + ,2.8 + ,12.9 + ,421.7 + ,214088 + ,2.7 + ,13.2 + ,422.1 + ,160275 + ,2.7 + ,13.1 + ,429.2 + ,186851 + ,2.7 + ,13.6 + ,452.1 + ,227777 + ,2.5 + ,14.4 + ,471.5 + ,246899 + ,2.4 + ,14.9 + ,488.3 + ,295338 + ,2.3 + ,15.3 + ,506.2 + ,243847 + ,2.3 + ,15.8 + ,517.3 + ,324602 + ,2.2 + ,16.2 + ,538.6 + ,347066 + ,2.3 + ,15.8 + ,545.3 + ,407916 + ,2.6 + ,12.8 + ,546.7 + ,312914 + ,2.7 + ,12.3 + ,540.3 + ,326127 + ,2.7 + ,12.3 + ,549.2 + ,394369 + ,2.6 + ,12.6 + ,563.9 + ,310078 + ,2.5 + ,12.9 + ,581.7 + ,422770 + ,2.5 + ,12.9 + ,590.7 + ,417974 + ,2.4 + ,13.4 + ,594.1 + ,402347 + ,2.5 + ,13.1 + ,604 + ,360809 + ,2.4 + ,13.1 + ,628.1 + ,298289 + ,2.3 + ,13.7 + ,662.4 + ,375873 + ,2.2 + ,14.5 + ,688.6 + ,407210 + ,2.2 + ,15 + ,705.9 + ,413968 + ,2.3 + ,15 + ,701.5 + ,457532 + ,2.4 + ,14.3 + ,686.2 + ,695731 + ,2.5 + ,13.5 + ,645.7 + ,544623 + ,2.5 + ,12.7 + ,668.7 + ,292833 + ,2.4 + ,13.1 + ,696.7 + ,534403 + ,2.4 + ,13.3 + ,715.5 + ,517030 + ,2.3 + ,13.8 + ,741.4 + ,455714 + ,2.2 + ,14 + ,754.3 + ,471401 + ,2.2 + ,14.1 + ,771.3 + ,451493 + ,2 + ,15 + ,797.7 + ,480615 + ,2 + ,15.2 + ,809.9 + ,568272 + ,2.2 + ,14.2 + ,790.1 + ,650780 + ,2.4 + ,12.7 + ,830.3 + ,553643 + ,2.4 + ,13 + ,847.7 + ,780711 + ,2.3 + ,13.2 + ,834.8 + ,650724 + ,2.4 + ,13 + ,824.5 + ,586345 + ,2.5 + ,12.4 + ,764.6 + ,725173 + ,2.5 + ,12.3 + ,780 + ,701257 + ,2.6 + ,11.9 + ,803.2 + ,859063 + ,2.5 + ,12.2 + ,751.1 + ,789842 + ,2.7 + ,11.5 + ,755.2 + ,512707 + ,2.7 + ,11.4 + ,708.2 + ,780845 + ,3.1 + ,10.1 + ,685.4 + ,637804 + ,3 + ,10.4 + ,680 + ,640694 + ,3.4 + ,10.7 + ,710.6 + ,553416 + ,3.3 + ,11.2 + ,702.8 + ,554622 + ,3.5 + ,10.7 + ,656.3 + ,616736 + ,4.1 + ,9.2 + ,575.6 + ,536994 + ,4.7 + ,7.6 + ,567.2 + ,407237 + ,4.4 + ,8 + ,545.2 + ,618796 + ,5.4 + ,6.6) + ,dim=c(4 + ,61) + ,dimnames=list(c('Aandelen_koersen' + ,'Verhandeld_kapitaal' + ,'Algemeen_rendement' + ,'K/W-verhouding') + ,1:61)) > y <- array(NA,dim=c(4,61),dimnames=list(c('Aandelen_koersen','Verhandeld_kapitaal','Algemeen_rendement','K/W-verhouding'),1:61)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = 'FALSE' > par3 = 'FALSE' > par2 = 'ALL' > par1 = 'ward' > ylab = '' > xlab = '' > main = '' > #'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 = 6043367] |--[dendrogram w/ 2 branches and 23 members at h = 1178543] | |--[dendrogram w/ 2 branches and 10 members at h = 94377] | | |--[dendrogram w/ 2 branches and 2 members at h = 4323] | | | |--leaf "37" | | | `--leaf "52" | | `--[dendrogram w/ 2 branches and 8 members at h = 66198] | | |--[dendrogram w/ 2 branches and 2 members at h = 18073] | | | |--leaf "42" | | | `--leaf "47" | | `--[dendrogram w/ 2 branches and 6 members at h = 38032] | | |--[dendrogram w/ 2 branches and 3 members at h = 1377] | | | |--leaf "57" | | | `--[dendrogram w/ 2 branches and 2 members at h = 257] | | | |--leaf "44" | | | `--leaf "56" | | `--[dendrogram w/ 2 branches and 3 members at h = 11035] | | |--leaf "34" | | `--[dendrogram w/ 2 branches and 2 members at h = 2594] | | |--leaf "36" | | `--leaf "59" | `--[dendrogram w/ 2 branches and 13 members at h = 596416] | |--[dendrogram w/ 2 branches and 4 members at h = 109842] | | |--leaf "50" | | `--[dendrogram w/ 2 branches and 3 members at h = 12021] | | |--leaf "51" | | `--[dendrogram w/ 2 branches and 2 members at h = 193] | | |--leaf "45" | | `--leaf "53" | `--[dendrogram w/ 2 branches and 9 members at h = 229808] | |--[dendrogram w/ 2 branches and 3 members at h = 33730] | | |--leaf "48" | | `--[dendrogram w/ 2 branches and 2 members at h = 5527] | | |--leaf "33" | | `--leaf "49" | `--[dendrogram w/ 2 branches and 6 members at h = 63089] | |--[dendrogram w/ 2 branches and 2 members at h = 2063] | | |--leaf "58" | | `--leaf "61" | `--[dendrogram w/ 2 branches and 4 members at h = 21527] | |--[dendrogram w/ 2 branches and 2 members at h = 71.7] | | |--leaf "43" | | `--leaf "46" | `--[dendrogram w/ 2 branches and 2 members at h = 2890] | |--leaf "54" | `--leaf "55" `--[dendrogram w/ 2 branches and 38 members at h = 2453704] |--[dendrogram w/ 2 branches and 15 members at h = 376209] | |--[dendrogram w/ 2 branches and 6 members at h = 58253] | | |--[dendrogram w/ 2 branches and 3 members at h = 8342] | | | |--leaf "7" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3052] | | | |--leaf "14" | | | `--leaf "16" | | `--[dendrogram w/ 2 branches and 3 members at h = 18336] | | |--leaf "10" | | `--[dendrogram w/ 2 branches and 2 members at h = 254] | | |--leaf "8" | | `--leaf "13" | `--[dendrogram w/ 2 branches and 9 members at h = 107329] | |--[dendrogram w/ 2 branches and 4 members at h = 25351] | | |--[dendrogram w/ 2 branches and 2 members at h = 4174] | | | |--leaf "5" | | | `--leaf "6" | | `--[dendrogram w/ 2 branches and 2 members at h = 10449] | | |--leaf "9" | | `--leaf "12" | `--[dendrogram w/ 2 branches and 5 members at h = 48938] | |--[dendrogram w/ 2 branches and 3 members at h = 9646] | | |--leaf "1" | | `--[dendrogram w/ 2 branches and 2 members at h = 293] | | |--leaf "3" | | `--leaf "11" | `--[dendrogram w/ 2 branches and 2 members at h = 15823] | |--leaf "2" | `--leaf "4" `--[dendrogram w/ 2 branches and 23 members at h = 784769] |--[dendrogram w/ 2 branches and 7 members at h = 61682] | |--[dendrogram w/ 2 branches and 3 members at h = 4770] | | |--leaf "28" | | `--[dendrogram w/ 2 branches and 2 members at h = 2511] | | |--leaf "15" | | `--leaf "35" | `--[dendrogram w/ 2 branches and 4 members at h = 25556] | |--[dendrogram w/ 2 branches and 2 members at h = 1525] | | |--leaf "17" | | `--leaf "21" | `--[dendrogram w/ 2 branches and 2 members at h = 2836] | |--leaf "20" | `--leaf "23" `--[dendrogram w/ 2 branches and 16 members at h = 335789] |--[dendrogram w/ 2 branches and 5 members at h = 41879] | |--[dendrogram w/ 2 branches and 3 members at h = 6234] | | |--leaf "40" | | `--[dendrogram w/ 2 branches and 2 members at h = 1818] | | |--leaf "32" | | `--leaf "38" | `--[dendrogram w/ 2 branches and 2 members at h = 9214] | |--leaf "39" | `--leaf "41" `--[dendrogram w/ 2 branches and 11 members at h = 161090] |--[dendrogram w/ 2 branches and 3 members at h = 24667] | |--leaf "29" | `--[dendrogram w/ 2 branches and 2 members at h = 13743] | |--leaf "18" | `--leaf "27" `--[dendrogram w/ 2 branches and 8 members at h = 37134] |--[dendrogram w/ 2 branches and 3 members at h = 7730] | |--leaf "24" | `--[dendrogram w/ 2 branches and 2 members at h = 4008] | |--leaf "25" | `--leaf "31" `--[dendrogram w/ 2 branches and 5 members at h = 17209] |--leaf "22" `--[dendrogram w/ 2 branches and 4 members at h = 7408] |--leaf "26" `--[dendrogram w/ 2 branches and 3 members at h = 892] |--leaf "19" `--[dendrogram w/ 2 branches and 2 members at h = 125] |--leaf "30" `--leaf "60" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/freestat/rcomp/tmp/1r6481226433687.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/freestat/rcomp/tmp/2ht9w1226433687.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/35zrg1226433687.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/freestat/rcomp/tmp/4w5g71226433687.tab") + } > > system("convert tmp/1r6481226433687.ps tmp/1r6481226433687.png") > system("convert tmp/2ht9w1226433687.ps tmp/2ht9w1226433687.png") convert: unable to open image `tmp/2ht9w1226433687.ps': No such file or directory. convert: missing an image filename `tmp/2ht9w1226433687.png'. > > > proc.time() user system elapsed 0.805 0.242 0.865