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(107.2 + ,80.6 + ,88.6 + ,96.1 + ,107 + ,104.1 + ,105.4 + ,94.9 + ,119 + ,108.2 + ,119.9 + ,99.9 + ,110.4 + ,93.4 + ,107.2 + ,96.3 + ,101.7 + ,71.9 + ,84.1 + ,89.5 + ,102.4 + ,94.1 + ,101.4 + ,104.6 + ,98.8 + ,94.9 + ,105.1 + ,101.5 + ,105.6 + ,96.4 + ,118.7 + ,109.8 + ,104.4 + ,91.1 + ,113.8 + ,112.1 + ,106.3 + ,84.4 + ,113.8 + ,110.1 + ,107.2 + ,86.4 + ,118.9 + ,107.1 + ,108.5 + ,88 + ,98.5 + ,108.1 + ,106.9 + ,75.1 + ,91 + ,99 + ,114.2 + ,109.7 + ,120.7 + ,104 + ,125.9 + ,103 + ,127.9 + ,106.7 + ,110.6 + ,82.1 + ,112.4 + ,101.1 + ,110.5 + ,68 + ,93.1 + ,97.8 + ,106.7 + ,96.4 + ,107.5 + ,113.8 + ,104.7 + ,94.3 + ,107.3 + ,107.1 + ,107.4 + ,90 + ,114.8 + ,117.5 + ,109.8 + ,88 + ,120.8 + ,113.7 + ,103.4 + ,76.1 + ,112.2 + ,106.6 + ,114.8 + ,82.5 + ,123.3 + ,109.8 + ,114.3 + ,81.4 + ,100.6 + ,108.8 + ,109.6 + ,66.5 + ,86.7 + ,102 + ,118.3 + ,97.2 + ,123.6 + ,114.5 + ,127.3 + ,94.1 + ,125.3 + ,116.5 + ,112.3 + ,80.7 + ,111.1 + ,108.6 + ,114.9 + ,70.5 + ,98.4 + ,113.9 + ,108.2 + ,87.8 + ,102.3 + ,109.3 + ,105.4 + ,89.5 + ,105 + ,112.5 + ,122.1 + ,99.6 + ,128.2 + ,123.4 + ,113.5 + ,84.2 + ,124.7 + ,115.2 + ,110 + ,75.1 + ,116.1 + ,110.8 + ,125.3 + ,92 + ,131.2 + ,120.4 + ,114.3 + ,80.8 + ,97.7 + ,117.6 + ,115.6 + ,73.1 + ,88.8 + ,111.2 + ,127.1 + ,99.8 + ,132.8 + ,131.1 + ,123 + ,90 + ,113.9 + ,118.9 + ,122.2 + ,83.1 + ,112.6 + ,115.7 + ,126.4 + ,72.4 + ,104.3 + ,119.6 + ,112.7 + ,78.8 + ,107.5 + ,113.1 + ,105.8 + ,87.3 + ,106 + ,106.4 + ,120.9 + ,91 + ,117.3 + ,115.5 + ,116.3 + ,80.1 + ,123.1 + ,111.8 + ,115.7 + ,73.6 + ,114.3 + ,109.6 + ,127.9 + ,86.4 + ,132 + ,121.5 + ,108.3 + ,74.5 + ,92.3 + ,109.5 + ,121.1 + ,71.2 + ,93.7 + ,109 + ,128.6 + ,92.4 + ,121.3 + ,113.4 + ,123.1 + ,81.5 + ,113.6 + ,112.7 + ,127.7 + ,85.3 + ,116.3 + ,114.4 + ,126.6 + ,69.9 + ,98.3 + ,109.2 + ,118.4 + ,84.2 + ,111.9 + ,116.2 + ,110 + ,90.7 + ,109.3 + ,113.8 + ,129.6 + ,100.3 + ,133.2 + ,123.6 + ,115.8 + ,79.4 + ,118 + ,112.6 + ,125.9 + ,84.8 + ,131.6 + ,117.7 + ,128.4 + ,92.9 + ,134.1 + ,113.3 + ,114 + ,81.6 + ,96.7 + ,110.7 + ,125.6 + ,76 + ,99.8 + ,114.7 + ,128.5 + ,98.7 + ,128.3 + ,116.9 + ,136.6 + ,89.1 + ,134.9 + ,120.6 + ,133.1 + ,88.7 + ,130.7 + ,111.6 + ,124.6 + ,67.1 + ,107.3 + ,111.9 + ,123.5 + ,93.6 + ,121.6 + ,116.1 + ,117.2 + ,97 + ,120.6 + ,111.9 + ,135.5 + ,100.8 + ,140.5 + ,125.1 + ,124.8 + ,80.1 + ,124.8 + ,115.1 + ,127.8 + ,80.7 + ,129.9 + ,116.7 + ,133.1 + ,89.4 + ,159.4 + ,115.8 + ,125.7 + ,81.5 + ,111 + ,117.2 + ,128.4 + ,73.6 + ,110.1 + ,113.6 + ,131.9 + ,90.9 + ,132.7 + ,107.2 + ,146.3 + ,97.3 + ,135 + ,115.2 + ,140.6 + ,84.3 + ,118.6 + ,111.4 + ,129.5 + ,65.6 + ,94 + ,109.4 + ,132.4 + ,87.3 + ,117.9 + ,123.5 + ,125.9 + ,90.5 + ,114.7 + ,123 + ,126.9 + ,82.4 + ,113.6 + ,119.8 + ,135.8 + ,80.4 + ,130.6 + ,115) + ,dim=c(4 + ,81) + ,dimnames=list(c('VoedingGenot' + ,'TextielKledingLeer' + ,'HoutKurkRiet' + ,'ChemischRubberAardolie') + ,1:81)) > y <- array(NA,dim=c(4,81),dimnames=list(c('VoedingGenot','TextielKledingLeer','HoutKurkRiet','ChemischRubberAardolie'),1:81)) > 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 = 'Jaar' > xlab = 'Be-verwerkende_Nijverheid' > 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 81 members at h = 500] |--[dendrogram w/ 2 branches and 26 members at h = 93.3] | |--[dendrogram w/ 2 branches and 10 members at h = 46.4] | | |--[dendrogram w/ 2 branches and 2 members at h = 6.54] | | | |--leaf "3" | | | `--leaf "14" | | `--[dendrogram w/ 2 branches and 8 members at h = 20] | | |--[dendrogram w/ 2 branches and 5 members at h = 15.4] | | | |--[dendrogram w/ 2 branches and 3 members at h = 5.82] | | | | |--leaf "50" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 5.34] | | | | |--leaf "27" | | | | `--leaf "66" | | | `--[dendrogram w/ 2 branches and 2 members at h = 9.17] | | | |--leaf "32" | | | `--leaf "62" | | `--[dendrogram w/ 2 branches and 3 members at h = 16.6] | | |--leaf "15" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.12] | | |--leaf "26" | | `--leaf "67" | `--[dendrogram w/ 2 branches and 16 members at h = 56.3] | |--[dendrogram w/ 2 branches and 12 members at h = 34.9] | | |--[dendrogram w/ 2 branches and 5 members at h = 15.4] | | | |--[dendrogram w/ 2 branches and 2 members at h = 6.16] | | | | |--leaf "69" | | | | `--leaf "70" | | | `--[dendrogram w/ 2 branches and 3 members at h = 7.83] | | | |--leaf "35" | | | `--[dendrogram w/ 2 branches and 2 members at h = 4.6] | | | |--leaf "47" | | | `--leaf "58" | | `--[dendrogram w/ 2 branches and 7 members at h = 22.4] | | |--leaf "76" | | `--[dendrogram w/ 2 branches and 6 members at h = 22] | | |--leaf "75" | | `--[dendrogram w/ 2 branches and 5 members at h = 17.8] | | |--[dendrogram w/ 2 branches and 3 members at h = 8.06] | | | |--leaf "59" | | | `--[dendrogram w/ 2 branches and 2 members at h = 5.44] | | | |--leaf "64" | | | `--leaf "74" | | `--[dendrogram w/ 2 branches and 2 members at h = 11.2] | | |--leaf "63" | | `--leaf "81" | `--[dendrogram w/ 2 branches and 4 members at h = 38.3] | |--leaf "71" | `--[dendrogram w/ 2 branches and 3 members at h = 12.3] | |--leaf "68" | `--[dendrogram w/ 2 branches and 2 members at h = 7.93] | |--leaf "38" | `--leaf "56" `--[dendrogram w/ 2 branches and 55 members at h = 251] |--[dendrogram w/ 2 branches and 18 members at h = 96.1] | |--[dendrogram w/ 2 branches and 5 members at h = 18.4] | | |--[dendrogram w/ 2 branches and 2 members at h = 7.85] | | | |--leaf "17" | | | `--leaf "25" | | `--[dendrogram w/ 2 branches and 3 members at h = 15.3] | | |--leaf "5" | | `--[dendrogram w/ 2 branches and 2 members at h = 6.67] | | |--leaf "1" | | `--leaf "13" | `--[dendrogram w/ 2 branches and 13 members at h = 54.7] | |--[dendrogram w/ 2 branches and 6 members at h = 21.5] | | |--[dendrogram w/ 2 branches and 2 members at h = 6.74] | | | |--leaf "53" | | | `--leaf "77" | | `--[dendrogram w/ 2 branches and 4 members at h = 12.9] | | |--[dendrogram w/ 2 branches and 2 members at h = 7.6] | | | |--leaf "41" | | | `--leaf "61" | | `--[dendrogram w/ 2 branches and 2 members at h = 8.21] | | |--leaf "65" | | `--leaf "73" | `--[dendrogram w/ 2 branches and 7 members at h = 22.9] | |--[dendrogram w/ 2 branches and 3 members at h = 9.42] | | |--leaf "36" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.35] | | |--leaf "24" | | `--leaf "60" | `--[dendrogram w/ 2 branches and 4 members at h = 11.7] | |--leaf "48" | `--[dendrogram w/ 2 branches and 3 members at h = 10.4] | |--leaf "29" | `--[dendrogram w/ 2 branches and 2 members at h = 7.92] | |--leaf "37" | `--leaf "49" `--[dendrogram w/ 2 branches and 37 members at h = 154] |--[dendrogram w/ 2 branches and 14 members at h = 41.8] | |--[dendrogram w/ 2 branches and 4 members at h = 18.8] | | |--[dendrogram w/ 2 branches and 2 members at h = 6.07] | | | |--leaf "6" | | | `--leaf "7" | | `--[dendrogram w/ 2 branches and 2 members at h = 11.5] | | |--leaf "2" | | `--leaf "4" | `--[dendrogram w/ 2 branches and 10 members at h = 27.8] | |--[dendrogram w/ 2 branches and 3 members at h = 10.3] | | |--leaf "8" | | `--[dendrogram w/ 2 branches and 2 members at h = 6.35] | | |--leaf "9" | | `--leaf "20" | `--[dendrogram w/ 2 branches and 7 members at h = 14.9] | |--[dendrogram w/ 2 branches and 2 members at h = 4] | | |--leaf "12" | | `--leaf "30" | `--[dendrogram w/ 2 branches and 5 members at h = 11.1] | |--[dendrogram w/ 2 branches and 2 members at h = 7.24] | | |--leaf "19" | | `--leaf "43" | `--[dendrogram w/ 2 branches and 3 members at h = 7.42] | |--leaf "18" | `--[dendrogram w/ 2 branches and 2 members at h = 6.54] | |--leaf "31" | `--leaf "55" `--[dendrogram w/ 2 branches and 23 members at h = 102] |--[dendrogram w/ 2 branches and 10 members at h = 23.4] | |--[dendrogram w/ 2 branches and 6 members at h = 11.4] | | |--[dendrogram w/ 2 branches and 3 members at h = 5.93] | | | |--leaf "54" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.66] | | | |--leaf "40" | | | `--leaf "51" | | `--[dendrogram w/ 2 branches and 3 members at h = 8.09] | | |--leaf "52" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.97] | | |--leaf "72" | | `--leaf "80" | `--[dendrogram w/ 2 branches and 4 members at h = 13.7] | |--leaf "78" | `--[dendrogram w/ 2 branches and 3 members at h = 8.12] | |--leaf "44" | `--[dendrogram w/ 2 branches and 2 members at h = 5.11] | |--leaf "39" | `--leaf "79" `--[dendrogram w/ 2 branches and 13 members at h = 37.6] |--[dendrogram w/ 2 branches and 5 members at h = 12.4] | |--[dendrogram w/ 2 branches and 2 members at h = 6.75] | | |--leaf "21" | | `--leaf "33" | `--[dendrogram w/ 2 branches and 3 members at h = 6.88] | |--leaf "57" | `--[dendrogram w/ 2 branches and 2 members at h = 3.47] | |--leaf "23" | `--leaf "45" `--[dendrogram w/ 2 branches and 8 members at h = 20.4] |--[dendrogram w/ 2 branches and 4 members at h = 12.0] | |--[dendrogram w/ 2 branches and 2 members at h = 6.08] | | |--leaf "28" | | `--leaf "42" | `--[dendrogram w/ 2 branches and 2 members at h = 6.28] | |--leaf "34" | `--leaf "46" `--[dendrogram w/ 2 branches and 4 members at h = 13.0] |--[dendrogram w/ 2 branches and 2 members at h = 6.31] | |--leaf "10" | `--leaf "11" `--[dendrogram w/ 2 branches and 2 members at h = 10.9] |--leaf "16" `--leaf "22" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1vjch1226314768.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/25k851226314769.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/3w6dh1226314769.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/46fqi1226314769.tab") + } > > system("convert tmp/1vjch1226314768.ps tmp/1vjch1226314768.png") > system("convert tmp/25k851226314769.ps tmp/25k851226314769.png") convert: unable to open image `tmp/25k851226314769.ps': No such file or directory. convert: missing an image filename `tmp/25k851226314769.png'. > > > proc.time() user system elapsed 0.877 0.196 1.027