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(97.6 + ,93.4 + ,83.6 + ,113.5 + ,99.5 + ,101.1 + ,86.5 + ,106.9 + ,110.7 + ,114.2 + ,96 + ,119.5 + ,104.4 + ,104.8 + ,91 + ,109.4 + ,99.8 + ,113.3 + ,87.2 + ,106.8 + ,108.4 + ,118.2 + ,84.5 + ,118.7 + ,91.8 + ,83.6 + ,59.1 + ,109 + ,90.2 + ,73.9 + ,61.6 + ,112.9 + ,109.2 + ,99.5 + ,98.8 + ,125.1 + ,111.4 + ,97.7 + ,97.9 + ,126.6 + ,102.8 + ,103 + ,92.8 + ,122.6 + ,91.5 + ,106.3 + ,84.2 + ,127.4 + ,98.9 + ,92.2 + ,74.6 + ,107.1 + ,100.8 + ,101.8 + ,79.8 + ,112 + ,112.1 + ,122.8 + ,86.7 + ,122.1 + ,106.7 + ,111.8 + ,79.8 + ,111.7 + ,103.5 + ,106.3 + ,87 + ,113.1 + ,111.3 + ,121.5 + ,91.3 + ,128.2 + ,100.8 + ,81.9 + ,58.7 + ,115.2 + ,94.2 + ,85.4 + ,62.8 + ,117.4 + ,115.5 + ,110.9 + ,87.8 + ,132 + ,114.1 + ,117.3 + ,90.4 + ,130.8 + ,105 + ,106.3 + ,80.6 + ,128 + ,94 + ,105.6 + ,73.5 + ,132.8 + ,98.3 + ,101.2 + ,71.5 + ,116.9 + ,96 + ,105.9 + ,70.6 + ,110.9 + ,101.8 + ,126.3 + ,78.3 + ,123.6 + ,102.5 + ,111.9 + ,76 + ,117.4 + ,98.7 + ,108.9 + ,77.4 + ,122.6 + ,110.7 + ,127.2 + ,80.9 + ,123.5 + ,88.7 + ,94.2 + ,63.5 + ,111.4 + ,89.2 + ,85.7 + ,58 + ,113.8 + ,106.8 + ,116.2 + ,88.2 + ,131.2 + ,104.1 + ,107.2 + ,81.2 + ,126.9 + ,103.2 + ,110.5 + ,84.9 + ,126.1 + ,93.7 + ,112 + ,76.4 + ,121.2 + ,100.5 + ,104.4 + ,71.5 + ,118.7 + ,98.7 + ,112 + ,76.1 + ,117.9 + ,111.1 + ,132.8 + ,82.9 + ,135.3 + ,104.5 + ,110.8 + ,78.1 + ,120.7 + ,105 + ,128.7 + ,82 + ,126.3 + ,109.7 + ,136.8 + ,84.7 + ,129.7 + ,92.6 + ,94.8 + ,55.7 + ,113.3 + ,94.2 + ,88.8 + ,59.5 + ,120.5 + ,111.7 + ,123.2 + ,83.2 + ,135.5 + ,113.4 + ,125.3 + ,87.6 + ,137.5 + ,106.8 + ,122.7 + ,76.2 + ,130.7 + ,98 + ,125.8 + ,76.4 + ,133.1 + ,104.2 + ,116.3 + ,68.2 + ,121.5 + ,105.4 + ,118.6 + ,70 + ,120.5 + ,117.5 + ,142.1 + ,76.3 + ,137 + ,107.9 + ,127.9 + ,70.9 + ,123.6 + ,107 + ,132 + ,72.5 + ,128.5 + ,113.3 + ,152.4 + ,80.1 + ,135 + ,97.6 + ,110.8 + ,57.4 + ,120.8 + ,98.2 + ,99.1 + ,62.7 + ,121.2 + ,111.3 + ,134.9 + ,82.6 + ,132.1 + ,116 + ,133.2 + ,88.9 + ,134.5 + ,108.1 + ,131 + ,80.5 + ,133.6 + ,95.6 + ,133.9 + ,72.1 + ,135.9 + ,110.8 + ,119.9 + ,69.4 + ,124.5) + ,dim=c(4 + ,61) + ,dimnames=list(c('Intem' + ,'inv' + ,'duurzamecons' + ,'nietduurzamecons') + ,1:61)) > y <- array(NA,dim=c(4,61),dimnames=list(c('Intem','inv','duurzamecons','nietduurzamecons'),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 = 450] |--[dendrogram w/ 2 branches and 27 members at h = 92.6] | |--[dendrogram w/ 2 branches and 9 members at h = 29.5] | | |--[dendrogram w/ 2 branches and 3 members at h = 14.6] | | | |--leaf "3" | | | `--[dendrogram w/ 2 branches and 2 members at h = 7.16] | | | |--leaf "6" | | | `--leaf "15" | | `--[dendrogram w/ 2 branches and 6 members at h = 20] | | |--[dendrogram w/ 2 branches and 2 members at h = 5.54] | | | |--leaf "45" | | | `--leaf "46" | | `--[dendrogram w/ 2 branches and 4 members at h = 11.3] | | |--leaf "21" | | `--[dendrogram w/ 2 branches and 3 members at h = 8.68] | | |--leaf "33" | | `--[dendrogram w/ 2 branches and 2 members at h = 5.75] | | |--leaf "18" | | `--leaf "22" | `--[dendrogram w/ 2 branches and 18 members at h = 83] | |--[dendrogram w/ 2 branches and 7 members at h = 32.0] | | |--[dendrogram w/ 2 branches and 5 members at h = 11.7] | | | |--leaf "58" | | | `--[dendrogram w/ 2 branches and 4 members at h = 7.45] | | | |--leaf "42" | | | `--[dendrogram w/ 2 branches and 3 members at h = 5.54] | | | |--leaf "59" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.84] | | | |--leaf "39" | | | `--leaf "57" | | `--[dendrogram w/ 2 branches and 2 members at h = 11.9] | | |--leaf "51" | | `--leaf "54" | `--[dendrogram w/ 2 branches and 11 members at h = 37.7] | |--[dendrogram w/ 2 branches and 3 members at h = 8.93] | | |--leaf "61" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.31] | | |--leaf "49" | | `--leaf "50" | `--[dendrogram w/ 2 branches and 8 members at h = 22.0] | |--[dendrogram w/ 2 branches and 3 members at h = 14.8] | | |--leaf "60" | | `--[dendrogram w/ 2 branches and 2 members at h = 9.64] | | |--leaf "47" | | `--leaf "48" | `--[dendrogram w/ 2 branches and 5 members at h = 16.0] | |--[dendrogram w/ 2 branches and 2 members at h = 6.65] | | |--leaf "52" | | `--leaf "53" | `--[dendrogram w/ 2 branches and 3 members at h = 8.6] | |--leaf "30" | `--[dendrogram w/ 2 branches and 2 members at h = 6.08] | |--leaf "27" | `--leaf "41" `--[dendrogram w/ 2 branches and 34 members at h = 223] |--[dendrogram w/ 2 branches and 8 members at h = 22.0] | |--[dendrogram w/ 2 branches and 2 members at h = 8.95] | | |--leaf "31" | | `--leaf "43" | `--[dendrogram w/ 2 branches and 6 members at h = 17.4] | |--[dendrogram w/ 2 branches and 3 members at h = 11.3] | | |--leaf "19" | | `--[dendrogram w/ 2 branches and 2 members at h = 5.66] | | |--leaf "20" | | `--leaf "44" | `--[dendrogram w/ 2 branches and 3 members at h = 13.5] | |--leaf "8" | `--[dendrogram w/ 2 branches and 2 members at h = 5.95] | |--leaf "7" | `--leaf "32" `--[dendrogram w/ 2 branches and 26 members at h = 93.9] |--[dendrogram w/ 2 branches and 15 members at h = 53] | |--[dendrogram w/ 2 branches and 5 members at h = 21.1] | | |--[dendrogram w/ 2 branches and 3 members at h = 10.0] | | | |--leaf "26" | | | `--[dendrogram w/ 2 branches and 2 members at h = 4.28] | | | |--leaf "25" | | | `--leaf "37" | | `--[dendrogram w/ 2 branches and 2 members at h = 12.9] | | |--leaf "55" | | `--leaf "56" | `--[dendrogram w/ 2 branches and 10 members at h = 29.3] | |--[dendrogram w/ 2 branches and 5 members at h = 10.7] | | |--[dendrogram w/ 2 branches and 2 members at h = 6.13] | | | |--leaf "29" | | | `--leaf "36" | | `--[dendrogram w/ 2 branches and 3 members at h = 6.31] | | |--leaf "40" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.84] | | |--leaf "28" | | `--leaf "38" | `--[dendrogram w/ 2 branches and 5 members at h = 22.8] | |--[dendrogram w/ 2 branches and 3 members at h = 7.18] | | |--leaf "35" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.79] | | |--leaf "23" | | `--leaf "34" | `--[dendrogram w/ 2 branches and 2 members at h = 12.3] | |--leaf "12" | `--leaf "24" `--[dendrogram w/ 2 branches and 11 members at h = 61.3] |--[dendrogram w/ 2 branches and 3 members at h = 13.4] | |--leaf "11" | `--[dendrogram w/ 2 branches and 2 members at h = 3.34] | |--leaf "9" | `--leaf "10" `--[dendrogram w/ 2 branches and 8 members at h = 31.3] |--[dendrogram w/ 2 branches and 4 members at h = 13.5] | |--[dendrogram w/ 2 branches and 2 members at h = 5.72] | | |--leaf "4" | | `--leaf "17" | `--[dendrogram w/ 2 branches and 2 members at h = 11.3] | |--leaf "5" | `--leaf "16" `--[dendrogram w/ 2 branches and 4 members at h = 14.2] |--leaf "13" `--[dendrogram w/ 2 branches and 3 members at h = 10.9] |--leaf "1" `--[dendrogram w/ 2 branches and 2 members at h = 8.55] |--leaf "2" `--leaf "14" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/freestat/rcomp/tmp/1z11u1227558344.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/28uvq1227558344.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/3kw9v1227558344.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/4yqkb1227558344.tab") + } > > system("convert tmp/1z11u1227558344.ps tmp/1z11u1227558344.png") > system("convert tmp/28uvq1227558344.ps tmp/28uvq1227558344.png") convert: unable to open image `tmp/28uvq1227558344.ps': No such file or directory. convert: missing an image filename `tmp/28uvq1227558344.png'. > > > proc.time() user system elapsed 0.828 0.252 0.901