R version 2.6.0 (2007-10-03) Copyright (C) 2007 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(96.8 + ,96.9 + ,96.7 + ,95.4 + ,96.8 + ,91.2 + ,98.0 + ,88.0 + ,101.2 + ,87.0 + ,97.1 + ,97.9 + ,96.7 + ,101.5 + ,96.3 + ,104.9 + ,100.9 + ,106.8 + ,101.9 + ,107.1 + ,110.9 + ,103.9 + ,114.3 + ,101.7 + ,115.2 + ,104.8 + ,103.1 + ,105.7 + ,100.1 + ,106.1 + ,94.1 + ,102.5 + ,90.1 + ,97.4 + ,89.5 + ,95.8 + ,104.3 + ,91.6 + ,96.5 + ,91.3 + ,99.3 + ,102.6 + ,97.7 + ,99.2 + ,97.6 + ,101.1 + ,101.7 + ,100.8 + ,102.2 + ,100.7 + ,104.0 + ,102.8 + ,104.6 + ,105.3 + ,104.6 + ,99.0 + ,105.4 + ,95.9 + ,111.1 + ,94.7 + ,105.4 + ,110.9 + ,102.7 + ,114.9 + ,101.8 + ,107.1 + ,113.5 + ,104.0 + ,124.5 + ,102.5 + ,110.7 + ,116.3 + ,107.9 + ,142.2 + ,105.3 + ,117.1 + ,124.0 + ,113.8 + ,159.7 + ,110.3 + ,118.7 + ,128.8 + ,113.8 + ,165.2 + ,109.8 + ,126.5 + ,133.5 + ,123.1 + ,198.6 + ,117.3 + ,127.5 + ,132.6 + ,125.1 + ,207.8 + ,118.8 + ,134.6 + ,128.4 + ,137.6 + ,219.6 + ,131.3 + ,131.8 + ,127.3 + ,134.0 + ,239.6 + ,125.9 + ,135.9 + ,126.7 + ,140.3 + ,235.3 + ,133.1 + ,142.7 + ,123.3 + ,152.1 + ,218.5 + ,147.0 + ,141.7 + ,123.2 + ,150.6 + ,213.8 + ,145.8 + ,153.4 + ,124.4 + ,167.3 + ,205.5 + ,164.4 + ,145.0 + ,128.2 + ,153.2 + ,198.4 + ,149.8 + ,137.7 + ,128.7 + ,142.0 + ,198.5 + ,137.7 + ,148.3 + ,135.7 + ,154.4 + ,190.2 + ,151.7 + ,152.2 + ,139.0 + ,158.5 + ,180.7 + ,156.8 + ,169.4 + ,145.4 + ,180.9 + ,193.6 + ,180.0 + ,168.6 + ,142.4 + ,181.3 + ,192.8 + ,180.4 + ,161.1 + ,137.7 + ,172.4 + ,195.5 + ,170.4 + ,174.1 + ,137.0 + ,192.0 + ,197.2 + ,191.6 + ,179.0 + ,137.1 + ,199.3 + ,196.9 + ,199.5 + ,190.6 + ,139.3 + ,215.4 + ,178.9 + ,218.2 + ,190.0 + ,139.6 + ,214.3 + ,172.4 + ,217.5 + ,181.6 + ,140.4 + ,201.5 + ,156.4 + ,205.0 + ,174.8 + ,142.3 + ,190.5 + ,143.7 + ,194.0 + ,180.5 + ,148.3 + ,196.0 + ,153.6 + ,199.3 + ,196.8 + ,157.7 + ,215.7 + ,168.8 + ,219.3 + ,193.8 + ,161.6 + ,209.4 + ,185.8 + ,211.1 + ,197.0 + ,161.7 + ,214.1 + ,199.9 + ,215.2 + ,216.3 + ,171.8 + ,237.8 + ,205.4 + ,240.2 + ,221.4 + ,185.1 + ,239.0 + ,197.5 + ,242.2 + ,217.9 + ,176.7 + ,237.8 + ,199.6 + ,240.7 + ,229.7 + ,184.4 + ,251.5 + ,200.5 + ,255.4 + ,227.4 + ,183.0 + ,248.8 + ,193.7 + ,253.0 + ,204.2 + ,180.9 + ,215.4 + ,179.6 + ,218.2 + ,196.6 + ,187.0 + ,201.2 + ,169.1 + ,203.7 + ,198.8 + ,189.9 + ,203.1 + ,169.8 + ,205.6 + ,207.5 + ,193.8 + ,214.2 + ,195.5 + ,215.6 + ,190.7 + ,194.5 + ,188.9 + ,194.8 + ,188.5 + ,201.6 + ,198.7 + ,203.0 + ,204.5 + ,202.9 + ,210.5 + ,204.7 + ,213.3 + ,203.8 + ,214.0 + ,223.5 + ,213.2 + ,228.5 + ,204.8 + ,230.3 + ,223.8 + ,214.7 + ,228.2 + ,204.9 + ,230.0 + ,231.2 + ,211.0 + ,240.9 + ,240.0 + ,241.0 + ,244.0 + ,213.2 + ,258.8 + ,248.3 + ,259.6 + ,234.7 + ,206.3 + ,248.5 + ,258.4 + ,247.8 + ,250.2 + ,210.8 + ,269.2 + ,254.9 + ,270.3) + ,dim=c(5 + ,60) + ,dimnames=list(c('1' + ,'2' + ,'3' + ,'4' + ,'5 ') + ,1:60)) > y <- array(NA,dim=c(5,60),dimnames=list(c('1','2','3','4','5 '),1:60)) > 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: Wessa, P., (2007), Hierarchical Clustering (v1.0.1) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_hierarchicalclustering.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 60 members at h = 3414] |--[dendrogram w/ 2 branches and 32 members at h = 765] | |--[dendrogram w/ 2 branches and 11 members at h = 214] | | |--[dendrogram w/ 2 branches and 4 members at h = 47.3] | | | |--[dendrogram w/ 2 branches and 2 members at h = 17.6] | | | | |--leaf "58" | | | | `--leaf "60" | | | `--[dendrogram w/ 2 branches and 2 members at h = 21.8] | | | |--leaf "57" | | | `--leaf "59" | | `--[dendrogram w/ 2 branches and 7 members at h = 98.8] | | |--[dendrogram w/ 2 branches and 2 members at h = 1.59] | | | |--leaf "55" | | | `--leaf "56" | | `--[dendrogram w/ 2 branches and 5 members at h = 40.5] | | |--[dendrogram w/ 2 branches and 2 members at h = 8.16] | | | |--leaf "46" | | | `--leaf "47" | | `--[dendrogram w/ 2 branches and 3 members at h = 14.7] | | |--leaf "44" | | `--[dendrogram w/ 2 branches and 2 members at h = 7.78] | | |--leaf "43" | | `--leaf "45" | `--[dendrogram w/ 2 branches and 21 members at h = 302] | |--[dendrogram w/ 2 branches and 6 members at h = 61.7] | | |--[dendrogram w/ 2 branches and 2 members at h = 11.8] | | | |--leaf "33" | | | `--leaf "34" | | `--[dendrogram w/ 2 branches and 4 members at h = 40] | | |--[dendrogram w/ 2 branches and 2 members at h = 3.26] | | | |--leaf "30" | | | `--leaf "31" | | `--[dendrogram w/ 2 branches and 2 members at h = 20.0] | | |--leaf "25" | | `--leaf "32" | `--[dendrogram w/ 2 branches and 15 members at h = 214] | |--[dendrogram w/ 2 branches and 7 members at h = 68.8] | | |--[dendrogram w/ 2 branches and 3 members at h = 30.2] | | | |--leaf "48" | | | `--[dendrogram w/ 2 branches and 2 members at h = 4.58] | | | |--leaf "49" | | | `--leaf "50" | | `--[dendrogram w/ 2 branches and 4 members at h = 45.4] | | |--leaf "52" | | `--[dendrogram w/ 2 branches and 3 members at h = 21.4] | | |--leaf "53" | | `--[dendrogram w/ 2 branches and 2 members at h = 14.1] | | |--leaf "51" | | `--leaf "54" | `--[dendrogram w/ 2 branches and 8 members at h = 112] | |--[dendrogram w/ 2 branches and 3 members at h = 20.3] | | |--leaf "38" | | `--[dendrogram w/ 2 branches and 2 members at h = 11.6] | | |--leaf "37" | | `--leaf "39" | `--[dendrogram w/ 2 branches and 5 members at h = 46.6] | |--[dendrogram w/ 2 branches and 2 members at h = 15.7] | | |--leaf "41" | | `--leaf "42" | `--[dendrogram w/ 2 branches and 3 members at h = 25.6] | |--leaf "40" | `--[dendrogram w/ 2 branches and 2 members at h = 6.66] | |--leaf "35" | `--leaf "36" `--[dendrogram w/ 2 branches and 28 members at h = 1221] |--[dendrogram w/ 2 branches and 15 members at h = 97] | |--[dendrogram w/ 2 branches and 8 members at h = 31.0] | | |--[dendrogram w/ 2 branches and 3 members at h = 10.8] | | | |--leaf "2" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.53] | | | |--leaf "7" | | | `--leaf "8" | | `--[dendrogram w/ 2 branches and 5 members at h = 17.9] | | |--leaf "12" | | `--[dendrogram w/ 2 branches and 4 members at h = 10.3] | | |--[dendrogram w/ 2 branches and 2 members at h = 5.68] | | | |--leaf "9" | | | `--leaf "10" | | `--[dendrogram w/ 2 branches and 2 members at h = 6.21] | | |--leaf "1" | | `--leaf "3" | `--[dendrogram w/ 2 branches and 7 members at h = 65.6] | |--[dendrogram w/ 2 branches and 4 members at h = 19.3] | | |--leaf "5" | | `--[dendrogram w/ 2 branches and 3 members at h = 6.12] | | |--leaf "11" | | `--[dendrogram w/ 2 branches and 2 members at h = 3.21] | | |--leaf "4" | | `--leaf "6" | `--[dendrogram w/ 2 branches and 3 members at h = 28.5] | |--leaf "15" | `--[dendrogram w/ 2 branches and 2 members at h = 10.2] | |--leaf "13" | `--leaf "14" `--[dendrogram w/ 2 branches and 13 members at h = 172] |--[dendrogram w/ 2 branches and 2 members at h = 7.49] | |--leaf "16" | `--leaf "17" `--[dendrogram w/ 2 branches and 11 members at h = 127] |--[dendrogram w/ 2 branches and 6 members at h = 53.7] | |--[dendrogram w/ 2 branches and 3 members at h = 20.2] | | |--leaf "29" | | `--[dendrogram w/ 2 branches and 2 members at h = 11.8] | | |--leaf "26" | | `--leaf "28" | `--[dendrogram w/ 2 branches and 3 members at h = 28.8] | |--leaf "27" | `--[dendrogram w/ 2 branches and 2 members at h = 5.18] | |--leaf "23" | `--leaf "24" `--[dendrogram w/ 2 branches and 5 members at h = 66.4] |--[dendrogram w/ 2 branches and 2 members at h = 9.63] | |--leaf "18" | `--leaf "19" `--[dendrogram w/ 2 branches and 3 members at h = 21.2] |--leaf "20" `--[dendrogram w/ 2 branches and 2 members at h = 11.3] |--leaf "21" `--leaf "22" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1xk1r1194257173.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/2tf3v1194257173.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) + } > 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/3h8q51194257174.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/4zgm81194257174.tab") + } > > system("convert tmp/1xk1r1194257173.ps tmp/1xk1r1194257173.png") > system("convert tmp/2tf3v1194257173.ps tmp/2tf3v1194257173.png") convert: unable to open image `tmp/2tf3v1194257173.ps': No such file or directory. convert: missing an image filename `tmp/2tf3v1194257173.png'. > > > proc.time() user system elapsed 0.871 0.215 0.956