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(-3 + ,17 + ,-1 + ,-2 + ,22 + ,1 + ,0 + ,29 + ,1 + ,1 + ,26 + ,-4 + ,11 + ,29 + ,0 + ,14 + ,42 + ,-2 + ,14 + ,40 + ,-5 + ,16 + ,34 + ,2 + ,14 + ,46 + ,0 + ,10 + ,43 + ,0 + ,15 + ,44 + ,4 + ,18 + ,40 + ,2 + ,18 + ,41 + ,3 + ,12 + ,42 + ,2 + ,8 + ,35 + ,2 + ,2 + ,40 + ,1 + ,-2 + ,43 + ,0 + ,-1 + ,47 + ,0 + ,1 + ,41 + ,1 + ,-6 + ,44 + ,0 + ,-16 + ,38 + ,0 + ,-21 + ,35 + ,-3 + ,-38 + ,34 + ,-5 + ,-32 + ,31 + ,-6 + ,-22 + ,25 + ,-2 + ,-31 + ,35 + ,-1 + ,-22 + ,36 + ,-3 + ,-26 + ,41 + ,-1 + ,-19 + ,41 + ,-1 + ,-20 + ,38 + ,-6 + ,-24 + ,39 + ,-2 + ,-29 + ,45 + ,-7 + ,-28 + ,46 + ,-7 + ,-31 + ,48 + ,-5 + ,-30 + ,48 + ,-10 + ,-32 + ,48 + ,-9 + ,-38 + ,45 + ,-7 + ,-43 + ,44 + ,-9 + ,-51 + ,45 + ,-9 + ,-43 + ,45 + ,-10 + ,-43 + ,45 + ,-9 + ,-42 + ,42 + ,-8 + ,-47 + ,43 + ,-9 + ,-45 + ,50 + ,-10 + ,-38 + ,46 + ,-8 + ,-46 + ,46 + ,-7 + ,-38 + ,45 + ,-8 + ,-32 + ,49 + ,-6 + ,-27 + ,46 + ,-7 + ,-26 + ,45 + ,-3 + ,-21 + ,49 + ,-6 + ,-23 + ,47 + ,-6 + ,-24 + ,45 + ,-4 + ,-17 + ,48 + ,-4 + ,-23 + ,51 + ,-7 + ,-16 + ,48 + ,-5 + ,-22 + ,49 + ,-6 + ,-26 + ,51 + ,-7 + ,-25 + ,54 + ,-4 + ,-21 + ,52 + ,-6 + ,-21 + ,52 + ,-5 + ,-18 + ,53 + ,-3 + ,-12 + ,51 + ,-4 + ,-19 + ,55 + ,-6 + ,-31 + ,53 + ,-8 + ,-38 + ,51 + ,-5 + ,-38 + ,52 + ,-7 + ,-32 + ,54 + ,-8 + ,-43 + ,58 + ,-8 + ,-33 + ,57 + ,-6 + ,-28 + ,52 + ,-7 + ,-25 + ,50 + ,-6 + ,-19 + ,53 + ,-2 + ,-20 + ,50 + ,-4 + ,-21 + ,50 + ,-5 + ,-19 + ,51 + ,-2 + ,-17 + ,53 + ,-4 + ,-16 + ,49 + ,-4 + ,-10 + ,54 + ,-5 + ,-16 + ,57 + ,-7 + ,-10 + ,58 + ,-5 + ,-8 + ,56 + ,-6 + ,-7 + ,60 + ,-4 + ,-15 + ,55 + ,-2 + ,-7 + ,54 + ,-3 + ,-6 + ,52 + ,0 + ,-6 + ,55 + ,-4 + ,2 + ,56 + ,-3 + ,-4 + ,54 + ,-3 + ,-4 + ,53 + ,-3 + ,-8 + ,59 + ,-4 + ,-10 + ,62 + ,-5 + ,-16 + ,63 + ,-5 + ,-14 + ,64 + ,-6 + ,-30 + ,75 + ,-10 + ,-33 + ,77 + ,-11 + ,-40 + ,79 + ,-13 + ,-38 + ,77 + ,-12 + ,-39 + ,82 + ,-13 + ,-46 + ,83 + ,-12 + ,-50 + ,81 + ,-15 + ,-55 + ,78 + ,-14 + ,-66 + ,79 + ,-16 + ,-63 + ,79 + ,-16 + ,-56 + ,73 + ,-12 + ,-66 + ,72 + ,-16) + ,dim=c(3 + ,106) + ,dimnames=list(c('ec.situatie' + ,'ontw.prijzen' + ,'fin.situatie.gezinnen') + ,1:106)) > y <- array(NA,dim=c(3,106),dimnames=list(c('ec.situatie','ontw.prijzen','fin.situatie.gezinnen'),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 = '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 106 members at h = 731] |--[dendrogram w/ 2 branches and 20 members at h = 89.6] | |--[dendrogram w/ 2 branches and 11 members at h = 27.2] | | |--[dendrogram w/ 2 branches and 3 members at h = 7.94] | | | |--leaf "8" | | | `--[dendrogram w/ 2 branches and 2 members at h = 7] | | | |--leaf "5" | | | `--leaf "15" | | `--[dendrogram w/ 2 branches and 8 members at h = 12.9] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.41] | | | |--leaf "12" | | | `--leaf "13" | | `--[dendrogram w/ 2 branches and 6 members at h = 10.3] | | |--[dendrogram w/ 2 branches and 2 members at h = 3.61] | | | |--leaf "6" | | | `--leaf "7" | | `--[dendrogram w/ 2 branches and 4 members at h = 6.46] | | |--[dendrogram w/ 2 branches and 2 members at h = 3] | | | |--leaf "10" | | | `--leaf "14" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.58] | | |--leaf "9" | | `--leaf "11" | `--[dendrogram w/ 2 branches and 9 members at h = 65.3] | |--[dendrogram w/ 2 branches and 5 members at h = 11.2] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.41] | | | |--leaf "16" | | | `--leaf "19" | | `--[dendrogram w/ 2 branches and 3 members at h = 5.26] | | |--leaf "20" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.12] | | |--leaf "17" | | `--leaf "18" | `--[dendrogram w/ 2 branches and 4 members at h = 12.9] | |--[dendrogram w/ 2 branches and 2 members at h = 5.48] | | |--leaf "1" | | `--leaf "2" | `--[dendrogram w/ 2 branches and 2 members at h = 5.92] | |--leaf "3" | `--leaf "4" `--[dendrogram w/ 2 branches and 86 members at h = 529] |--[dendrogram w/ 2 branches and 12 members at h = 84.5] | |--[dendrogram w/ 2 branches and 5 members at h = 15.6] | | |--[dendrogram w/ 2 branches and 2 members at h = 3.74] | | | |--leaf "95" | | | `--leaf "96" | | `--[dendrogram w/ 2 branches and 3 members at h = 4.57] | | |--leaf "99" | | `--[dendrogram w/ 2 branches and 2 members at h = 3] | | |--leaf "97" | | `--leaf "98" | `--[dendrogram w/ 2 branches and 7 members at h = 32.2] | |--[dendrogram w/ 2 branches and 3 members at h = 8.74] | | |--leaf "106" | | `--[dendrogram w/ 2 branches and 2 members at h = 3] | | |--leaf "103" | | `--leaf "104" | `--[dendrogram w/ 2 branches and 4 members at h = 15.1] | |--[dendrogram w/ 2 branches and 2 members at h = 5.39] | | |--leaf "100" | | `--leaf "101" | `--[dendrogram w/ 2 branches and 2 members at h = 5.48] | |--leaf "102" | `--leaf "105" `--[dendrogram w/ 2 branches and 74 members at h = 344] |--[dendrogram w/ 2 branches and 24 members at h = 84.2] | |--[dendrogram w/ 2 branches and 11 members at h = 21.7] | | |--[dendrogram w/ 2 branches and 3 members at h = 1.28] | | | |--leaf "45" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1] | | | |--leaf "37" | | | `--leaf "47" | | `--[dendrogram w/ 2 branches and 8 members at h = 12.3] | | |--[dendrogram w/ 2 branches and 4 members at h = 4.18] | | | |--leaf "42" | | | `--[dendrogram w/ 2 branches and 3 members at h = 1.28] | | | |--leaf "40" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1] | | | |--leaf "38" | | | `--leaf "41" | | `--[dendrogram w/ 2 branches and 4 members at h = 7.88] | | |--leaf "44" | | `--[dendrogram w/ 2 branches and 3 members at h = 5.39] | | |--leaf "39" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.74] | | |--leaf "43" | | `--leaf "46" | `--[dendrogram w/ 2 branches and 13 members at h = 35.3] | |--[dendrogram w/ 2 branches and 7 members at h = 10.2] | | |--[dendrogram w/ 2 branches and 3 members at h = 2.1] | | | |--leaf "32" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1] | | | |--leaf "33" | | | `--leaf "49" | | `--[dendrogram w/ 2 branches and 4 members at h = 6.5] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.73] | | | |--leaf "34" | | | `--leaf "48" | | `--[dendrogram w/ 2 branches and 2 members at h = 2.24] | | |--leaf "35" | | `--leaf "36" | `--[dendrogram w/ 2 branches and 6 members at h = 16.5] | |--[dendrogram w/ 2 branches and 3 members at h = 5.29] | | |--leaf "70" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.41] | | |--leaf "65" | | `--leaf "68" | `--[dendrogram w/ 2 branches and 3 members at h = 10.6] | |--leaf "69" | `--[dendrogram w/ 2 branches and 2 members at h = 2.24] | |--leaf "66" | `--leaf "67" `--[dendrogram w/ 2 branches and 50 members at h = 213] |--[dendrogram w/ 2 branches and 16 members at h = 33.0] | |--[dendrogram w/ 2 branches and 6 members at h = 11.2] | | |--leaf "88" | | `--[dendrogram w/ 2 branches and 5 members at h = 5.21] | | |--leaf "86" | | `--[dendrogram w/ 2 branches and 4 members at h = 4.44] | | |--[dendrogram w/ 2 branches and 2 members at h = 1] | | | |--leaf "89" | | | `--leaf "90" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.73] | | |--leaf "85" | | `--leaf "87" | `--[dendrogram w/ 2 branches and 10 members at h = 19.3] | |--[dendrogram w/ 2 branches and 2 members at h = 2.45] | | |--leaf "93" | | `--leaf "94" | `--[dendrogram w/ 2 branches and 8 members at h = 15.3] | |--[dendrogram w/ 2 branches and 4 members at h = 4.47] | | |--leaf "92" | | `--[dendrogram w/ 2 branches and 3 members at h = 3.66] | | |--leaf "81" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.41] | | |--leaf "83" | | `--leaf "91" | `--[dendrogram w/ 2 branches and 4 members at h = 8.05] | |--[dendrogram w/ 2 branches and 2 members at h = 3] | | |--leaf "79" | | `--leaf "82" | `--[dendrogram w/ 2 branches and 2 members at h = 5.39] | |--leaf "63" | `--leaf "84" `--[dendrogram w/ 2 branches and 34 members at h = 136] |--[dendrogram w/ 2 branches and 21 members at h = 31.8] | |--[dendrogram w/ 2 branches and 12 members at h = 15.2] | | |--[dendrogram w/ 2 branches and 5 members at h = 5.46] | | | |--leaf "59" | | | `--[dendrogram w/ 2 branches and 4 members at h = 4.34] | | | |--leaf "71" | | | `--[dendrogram w/ 2 branches and 3 members at h = 3.06] | | | |--leaf "55" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.73] | | | |--leaf "58" | | | `--leaf "72" | | `--[dendrogram w/ 2 branches and 7 members at h = 6.68] | | |--[dendrogram w/ 2 branches and 3 members at h = 3.04] | | | |--leaf "52" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1] | | | |--leaf "51" | | | `--leaf "57" | | `--[dendrogram w/ 2 branches and 4 members at h = 3.64] | | |--[dendrogram w/ 2 branches and 2 members at h = 1] | | | |--leaf "60" | | | `--leaf "61" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.41] | | |--leaf "74" | | `--leaf "75" | `--[dendrogram w/ 2 branches and 9 members at h = 15.9] | |--[dendrogram w/ 2 branches and 3 members at h = 1.41] | | |--leaf "78" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.41] | | |--leaf "54" | | `--leaf "56" | `--[dendrogram w/ 2 branches and 6 members at h = 9.87] | |--[dendrogram w/ 2 branches and 4 members at h = 3.01] | | |--leaf "76" | | `--[dendrogram w/ 2 branches and 3 members at h = 2.36] | | |--leaf "77" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.41] | | |--leaf "62" | | `--leaf "73" | `--[dendrogram w/ 2 branches and 2 members at h = 3.74] | |--leaf "64" | `--leaf "80" `--[dendrogram w/ 2 branches and 13 members at h = 38] |--[dendrogram w/ 2 branches and 3 members at h = 7.78] | |--leaf "23" | `--[dendrogram w/ 2 branches and 2 members at h = 6.48] | |--leaf "24" | `--leaf "26" `--[dendrogram w/ 2 branches and 10 members at h = 23.4] |--[dendrogram w/ 2 branches and 4 members at h = 8.67] | |--[dendrogram w/ 2 branches and 2 members at h = 2.24] | | |--leaf "50" | | `--leaf "53" | `--[dendrogram w/ 2 branches and 2 members at h = 3] | |--leaf "28" | `--leaf "31" `--[dendrogram w/ 2 branches and 6 members at h = 18.3] |--leaf "25" `--[dendrogram w/ 2 branches and 5 members at h = 10.5] |--[dendrogram w/ 2 branches and 2 members at h = 4.36] | |--leaf "21" | `--leaf "29" `--[dendrogram w/ 2 branches and 3 members at h = 5.18] |--leaf "30" `--[dendrogram w/ 2 branches and 2 members at h = 1.41] |--leaf "22" `--leaf "27" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1tx7s1226517880.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/2pb491226517880.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/3w7761226517880.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/4o2z81226517880.tab") + } > > system("convert tmp/1tx7s1226517880.ps tmp/1tx7s1226517880.png") > system("convert tmp/2pb491226517880.ps tmp/2pb491226517880.png") convert: unable to open image `tmp/2pb491226517880.ps': No such file or directory. convert: missing an image filename `tmp/2pb491226517880.png'. > > > proc.time() user system elapsed 0.956 0.223 1.083