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(97.3 + ,93.5 + ,93.5 + ,124.9 + ,101 + ,94.7 + ,94.7 + ,132 + ,113.2 + ,112.9 + ,112.9 + ,151.4 + ,101 + ,99.2 + ,99.2 + ,108.9 + ,105.7 + ,105.6 + ,105.6 + ,121.3 + ,113.9 + ,113 + ,113 + ,123.4 + ,86.4 + ,83.1 + ,83.1 + ,90.3 + ,96.5 + ,81.1 + ,81.1 + ,79.3 + ,103.3 + ,96.9 + ,96.9 + ,117.2 + ,114.9 + ,104.3 + ,104.3 + ,116.9 + ,105.8 + ,97.7 + ,97.7 + ,120.8 + ,94.2 + ,102.6 + ,102.6 + ,96.1 + ,98.4 + ,89.9 + ,89.9 + ,100.8 + ,99.4 + ,96 + ,96 + ,105.3 + ,108.8 + ,112.7 + ,112.7 + ,116.1 + ,112.6 + ,107.1 + ,107.1 + ,112.8 + ,104.4 + ,106.2 + ,106.2 + ,114.5 + ,112.2 + ,121 + ,121 + ,117.2 + ,81.1 + ,101.2 + ,101.2 + ,77.1 + ,97.1 + ,83.2 + ,83.2 + ,80.1 + ,112.6 + ,105.1 + ,105.1 + ,120.3 + ,113.8 + ,113.3 + ,113.3 + ,133.4 + ,107.8 + ,99.1 + ,99.1 + ,109.4 + ,103.2 + ,100.3 + ,100.3 + ,93.2 + ,103.3 + ,93.5 + ,93.5 + ,91.2 + ,101.2 + ,98.8 + ,98.8 + ,99.2 + ,107.7 + ,106.2 + ,106.2 + ,108.2 + ,110.4 + ,98.3 + ,98.3 + ,101.5 + ,101.9 + ,102.1 + ,102.1 + ,106.9 + ,115.9 + ,117.1 + ,117.1 + ,104.4 + ,89.9 + ,101.5 + ,101.5 + ,77.9 + ,88.6 + ,80.5 + ,80.5 + ,60 + ,117.2 + ,105.9 + ,105.9 + ,99.5 + ,123.9 + ,109.5 + ,109.5 + ,95 + ,100 + ,97.2 + ,97.2 + ,105.6 + ,103.6 + ,114.5 + ,114.5 + ,102.5 + ,94.1 + ,93.5 + ,93.5 + ,93.3 + ,98.7 + ,100.9 + ,100.9 + ,97.3 + ,119.5 + ,121.1 + ,121.1 + ,127 + ,112.7 + ,116.5 + ,116.5 + ,111.7 + ,104.4 + ,109.3 + ,109.3 + ,96.4 + ,124.7 + ,118.1 + ,118.1 + ,133 + ,89.1 + ,108.3 + ,108.3 + ,72.2 + ,97 + ,105.4 + ,105.4 + ,95.8 + ,121.6 + ,116.2 + ,116.2 + ,124.1 + ,118.8 + ,111.2 + ,111.2 + ,127.6 + ,114 + ,105.8 + ,105.8 + ,110.7 + ,111.5 + ,122.7 + ,122.7 + ,104.6 + ,97.2 + ,99.5 + ,99.5 + ,112.7 + ,102.5 + ,107.9 + ,107.9 + ,115.3 + ,113.4 + ,124.6 + ,124.6 + ,139.4 + ,109.8 + ,115 + ,115 + ,119 + ,104.9 + ,110.3 + ,110.3 + ,97.4 + ,126.1 + ,132.7 + ,132.7 + ,154 + ,80 + ,99.7 + ,99.7 + ,81.5 + ,96.8 + ,96.5 + ,96.5 + ,88.8 + ,117.2 + ,118.7 + ,118.7 + ,127.7 + ,112.3 + ,112.9 + ,112.9 + ,105.1 + ,117.3 + ,130.5 + ,130.5 + ,114.9 + ,111.1 + ,137.9 + ,137.9 + ,106.4 + ,102.2 + ,115 + ,115 + ,104.5 + ,104.3 + ,116.8 + ,116.8 + ,121.6 + ,122.9 + ,140.9 + ,140.9 + ,141.4 + ,107.6 + ,120.7 + ,120.7 + ,99 + ,121.3 + ,134.2 + ,134.2 + ,126.7 + ,131.5 + ,147.3 + ,147.3 + ,134.1 + ,89 + ,112.4 + ,112.4 + ,81.3 + ,104.4 + ,107.1 + ,107.1 + ,88.6 + ,128.9 + ,128.4 + ,128.4 + ,132.7 + ,135.9 + ,137.7 + ,137.7 + ,132.9 + ,133.3 + ,135 + ,135 + ,134.4 + ,121.3 + ,151 + ,151 + ,103.7 + ,120.5 + ,137.4 + ,137.4 + ,119.7 + ,120.4 + ,132.4 + ,132.4 + ,115 + ,137.9 + ,161.3 + ,161.3 + ,132.9 + ,126.1 + ,139.8 + ,139.8 + ,108.5 + ,133.2 + ,146 + ,146 + ,113.9 + ,146.6 + ,154.6 + ,154.6 + ,142.9 + ,103.4 + ,142.1 + ,142.1 + ,95.2 + ,117.2 + ,120.5 + ,120.5 + ,93) + ,dim=c(4 + ,80) + ,dimnames=list(c('A' + ,'B' + ,'C' + ,'D') + ,1:80)) > y <- array(NA,dim=c(4,80),dimnames=list(c('A','B','C','D'),1:80)) > 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 = 'complete' > ylab = 'height' > xlab = 'cases' > main = 'Dendrogram' > 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 80 members at h = 146] |--[dendrogram w/ 2 branches and 30 members at h = 78] | |--[dendrogram w/ 2 branches and 8 members at h = 44] | | |--leaf "32" | | `--[dendrogram w/ 2 branches and 7 members at h = 24.9] | | |--[dendrogram w/ 2 branches and 3 members at h = 15.2] | | | |--leaf "7" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.13] | | | |--leaf "8" | | | `--leaf "20" | | `--[dendrogram w/ 2 branches and 4 members at h = 15.3] | | |--leaf "13" | | `--[dendrogram w/ 2 branches and 3 members at h = 9.44] | | |--leaf "25" | | `--[dendrogram w/ 2 branches and 2 members at h = 6.75] | | |--leaf "37" | | `--leaf "56" | `--[dendrogram w/ 2 branches and 22 members at h = 51] | |--[dendrogram w/ 2 branches and 9 members at h = 25.0] | | |--[dendrogram w/ 2 branches and 2 members at h = 9.54] | | | |--leaf "33" | | | `--leaf "34" | | `--[dendrogram w/ 2 branches and 7 members at h = 20.4] | | |--[dendrogram w/ 2 branches and 3 members at h = 13.3] | | | |--leaf "80" | | | `--[dendrogram w/ 2 branches and 2 members at h = 7.39] | | | |--leaf "48" | | | `--leaf "64" | | `--[dendrogram w/ 2 branches and 4 members at h = 14.0] | | |--[dendrogram w/ 2 branches and 2 members at h = 2.54] | | | |--leaf "36" | | | `--leaf "61" | | `--[dendrogram w/ 2 branches and 2 members at h = 6.98] | | |--leaf "30" | | `--leaf "58" | `--[dendrogram w/ 2 branches and 13 members at h = 33.8] | |--[dendrogram w/ 2 branches and 8 members at h = 16.8] | | |--[dendrogram w/ 2 branches and 3 members at h = 9.9] | | | |--leaf "68" | | | `--[dendrogram w/ 2 branches and 2 members at h = 1.80] | | | |--leaf "41" | | | `--leaf "53" | | `--[dendrogram w/ 2 branches and 5 members at h = 10.8] | | |--[dendrogram w/ 2 branches and 2 members at h = 4.86] | | | |--leaf "12" | | | `--leaf "44" | | `--[dendrogram w/ 2 branches and 3 members at h = 6.67] | | |--leaf "24" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.32] | | |--leaf "26" | | `--leaf "38" | `--[dendrogram w/ 2 branches and 5 members at h = 20.1] | |--[dendrogram w/ 2 branches and 2 members at h = 10.8] | | |--leaf "43" | | `--leaf "67" | `--[dendrogram w/ 2 branches and 3 members at h = 10.8] | |--leaf "31" | `--[dendrogram w/ 2 branches and 2 members at h = 5.01] | |--leaf "19" | `--leaf "55" `--[dendrogram w/ 2 branches and 50 members at h = 104] |--[dendrogram w/ 2 branches and 33 members at h = 54.7] | |--[dendrogram w/ 2 branches and 19 members at h = 32.3] | | |--[dendrogram w/ 2 branches and 4 members at h = 15.3] | | | |--[dendrogram w/ 2 branches and 2 members at h = 4.53] | | | | |--leaf "9" | | | | `--leaf "11" | | | `--[dendrogram w/ 2 branches and 2 members at h = 8.18] | | | |--leaf "1" | | | `--leaf "2" | | `--[dendrogram w/ 2 branches and 15 members at h = 23.8] | | |--[dendrogram w/ 2 branches and 8 members at h = 13.5] | | | |--[dendrogram w/ 2 branches and 3 members at h = 7.54] | | | | |--leaf "5" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.17] | | | | |--leaf "17" | | | | `--leaf "50" | | | `--[dendrogram w/ 2 branches and 5 members at h = 13.1] | | | |--[dendrogram w/ 2 branches and 2 members at h = 4.26] | | | | |--leaf "10" | | | | `--leaf "21" | | | `--[dendrogram w/ 2 branches and 3 members at h = 6.84] | | | |--leaf "27" | | | `--[dendrogram w/ 2 branches and 2 members at h = 3.12] | | | |--leaf "16" | | | `--leaf "47" | | `--[dendrogram w/ 2 branches and 7 members at h = 17.4] | | |--leaf "28" | | `--[dendrogram w/ 2 branches and 6 members at h = 11.1] | | |--[dendrogram w/ 2 branches and 3 members at h = 7.69] | | | |--leaf "23" | | | `--[dendrogram w/ 2 branches and 2 members at h = 4.65] | | | |--leaf "4" | | | `--leaf "29" | | `--[dendrogram w/ 2 branches and 3 members at h = 9.17] | | |--leaf "49" | | `--[dendrogram w/ 2 branches and 2 members at h = 1.82] | | |--leaf "14" | | `--leaf "35" | `--[dendrogram w/ 2 branches and 14 members at h = 40] | |--[dendrogram w/ 2 branches and 2 members at h = 20.4] | | |--leaf "3" | | `--leaf "51" | `--[dendrogram w/ 2 branches and 12 members at h = 24.6] | |--[dendrogram w/ 2 branches and 5 members at h = 13] | | |--[dendrogram w/ 2 branches and 3 members at h = 8.14] | | | |--leaf "40" | | | `--[dendrogram w/ 2 branches and 2 members at h = 4.47] | | | |--leaf "15" | | | `--leaf "52" | | `--[dendrogram w/ 2 branches and 2 members at h = 10.8] | | |--leaf "18" | | `--leaf "62" | `--[dendrogram w/ 2 branches and 7 members at h = 16.1] | |--[dendrogram w/ 2 branches and 4 members at h = 9.8] | | |--leaf "42" | | `--[dendrogram w/ 2 branches and 3 members at h = 7.8] | | |--leaf "45" | | `--[dendrogram w/ 2 branches and 2 members at h = 4.16] | | |--leaf "39" | | `--leaf "57" | `--[dendrogram w/ 2 branches and 3 members at h = 10] | |--leaf "22" | `--[dendrogram w/ 2 branches and 2 members at h = 6.94] | |--leaf "6" | `--leaf "46" `--[dendrogram w/ 2 branches and 17 members at h = 66.7] |--[dendrogram w/ 2 branches and 9 members at h = 37.9] | |--[dendrogram w/ 2 branches and 2 members at h = 14.8] | | |--leaf "60" | | `--leaf "79" | `--[dendrogram w/ 2 branches and 7 members at h = 33.1] | |--[dendrogram w/ 2 branches and 4 members at h = 13.5] | | |--[dendrogram w/ 2 branches and 2 members at h = 4.1] | | | |--leaf "59" | | | `--leaf "74" | | `--[dendrogram w/ 2 branches and 2 members at h = 8.37] | | |--leaf "65" | | `--leaf "73" | `--[dendrogram w/ 2 branches and 3 members at h = 17.2] | |--leaf "72" | `--[dendrogram w/ 2 branches and 2 members at h = 12.5] | |--leaf "76" | `--leaf "77" `--[dendrogram w/ 2 branches and 8 members at h = 47.4] |--[dendrogram w/ 2 branches and 2 members at h = 16.3] | |--leaf "75" | `--leaf "78" `--[dendrogram w/ 2 branches and 6 members at h = 29.2] |--[dendrogram w/ 2 branches and 2 members at h = 14.5] | |--leaf "63" | `--leaf "66" `--[dendrogram w/ 2 branches and 4 members at h = 24.3] |--leaf "54" `--[dendrogram w/ 2 branches and 3 members at h = 14.9] |--leaf "69" `--[dendrogram w/ 2 branches and 2 members at h = 4.86] |--leaf "70" `--leaf "71" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1u56o1194297027.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/2jp9x1194297027.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/3j0o21194297027.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/4nbee1194297028.tab") + } > > system("convert tmp/1u56o1194297027.ps tmp/1u56o1194297027.png") > system("convert tmp/2jp9x1194297027.ps tmp/2jp9x1194297027.png") convert: unable to open image `tmp/2jp9x1194297027.ps': No such file or directory. convert: missing an image filename `tmp/2jp9x1194297027.png'. > > > proc.time() user system elapsed 0.965 0.223 1.054