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.3 + ,2.36 + ,5.41 + ,2.86 + ,1.95 + ,5.46 + ,2.27 + ,2.16 + ,5.64 + ,1.95 + ,2.76 + ,5.76 + ,2.98 + ,2.09 + ,5.82 + ,1.71 + ,1.49 + ,5.84 + ,1.31 + ,1.17 + ,5.83 + ,1.37 + ,1.3 + ,5.85 + ,1.8 + ,1.26 + ,5.85 + ,2.14 + ,2.17 + ,5.88 + ,2.05 + ,2.03 + ,5.87 + ,2.43 + ,2.18 + ,5.87 + ,5.28 + ,2.61 + ,5.85 + ,4.07 + ,2.58 + ,5.89 + ,3.24 + ,3.86 + ,5.88 + ,1.22 + ,3.81 + ,5.89 + ,1.18 + ,2.41 + ,5.9 + ,1 + ,1.47 + ,5.91 + ,1.18 + ,1.33 + ,5.89 + ,1.86 + ,1.38 + ,5.92 + ,2.38 + ,1.57 + ,5.91 + ,1.48 + ,2.6 + ,5.96 + ,1.62 + ,2.18 + ,5.96 + ,2.44 + ,2.36 + ,5.99 + ,3.91 + ,2.24 + ,5.92 + ,3.83 + ,2.41 + ,5.96 + ,2.9 + ,2.51 + ,5.96 + ,1.67 + ,2.98 + ,5.97 + ,1.19 + ,1.87 + ,5.96 + ,1.26 + ,1.9 + ,5.95 + ,1.6 + ,1.47 + ,5.97 + ,2.61 + ,1.45 + ,5.98 + ,2.19 + ,2.71 + ,5.99 + ,1.46 + ,2.9 + ,6.03 + ,2.17 + ,2.11 + ,6.05 + ,2.6 + ,2.18 + ,6.08 + ,4.33 + ,2.24 + ,6.1 + ,2.9 + ,2.05 + ,6.11 + ,2.05 + ,2.42 + ,6.09 + ,1.51 + ,2.77 + ,6.1 + ,1.19 + ,1.99 + ,6.12 + ,1.08 + ,1.47 + ,6.13 + ,1.1 + ,1.09 + ,6.13 + ,1.39 + ,0.93 + ,6.17 + ,1.35 + ,1.32 + ,6.19 + ,1.69 + ,2.03 + ,6.23 + ,2.35 + ,2.04 + ,6.21 + ,3.7 + ,2.78 + ,6.23 + ,3.55 + ,2.8 + ,6.25 + ,3.75 + ,3.03 + ,6.23 + ,4.23 + ,3.11 + ,6.23 + ,2.13 + ,2.75 + ,6.24 + ,1.33 + ,2.78 + ,6.28 + ,1.46 + ,1.76 + ,6.3 + ,2.1 + ,1.29 + ,6.34 + ,1.76 + ,1.28 + ,6.27 + ,1.28 + ,1.43 + ,6.22 + ,1.26 + ,1.71 + ,6.31 + ,1.99 + ,1.89 + ,6.33 + ,3.06 + ,1.84 + ,6.31 + ,3.33 + ,2.08 + ,6.35 + ,4.02 + ,2.09 + ,6.33 + ,2.43 + ,2.36 + ,6.36 + ,1.39 + ,2.99 + ,6.37 + ,1.52 + ,2.75 + ,6.33 + ,1.75 + ,1.58 + ,6.34 + ,2.22 + ,1.69 + ,6.42 + ,2.57 + ,1.3 + ,6.42 + ,2.37 + ,1.97 + ,6.48 + ,1.69 + ,1.84 + ,6.47 + ,2.71 + ,1.96 + ,6.5 + ,3.06 + ,1.86 + ,6.52 + ,4.64 + ,2.75 + ,6.49 + ,3.22 + ,2.62 + ,6.51 + ,2.35 + ,2.41 + ,6.52 + ,2.01 + ,3.61 + ,6.54 + ,1.49 + ,2.03 + ,6.59 + ,1.31 + ,1.45 + ,6.6 + ,1.29 + ,1.4 + ,6.59 + ,1.33 + ,1.3 + ,6.58 + ,1.33 + ,1.58 + ,6.55 + ,1.39 + ,2.1 + ,6.57 + ,2.39 + ,2.27 + ,6.61 + ,3.04 + ,2.54 + ,6.61) + ,dim=c(3 + ,84) + ,dimnames=list(c('Kropsla' + ,'Tomaten' + ,'Gehakt') + ,1:84)) > y <- array(NA,dim=c(3,84),dimnames=list(c('Kropsla','Tomaten','Gehakt'),1:84)) > 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 84 members at h = 29.9] |--[dendrogram w/ 2 branches and 35 members at h = 4.92] | |--[dendrogram w/ 2 branches and 9 members at h = 1.96] | | |--[dendrogram w/ 2 branches and 3 members at h = 0.627] | | | |--leaf "68" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.269] | | | |--leaf "21" | | | `--leaf "32" | | `--[dendrogram w/ 2 branches and 6 members at h = 0.891] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.347] | | | |--leaf "55" | | | `--leaf "56" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.36] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.151] | | | |--leaf "9" | | | `--leaf "20" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.171] | | |--leaf "6" | | `--leaf "31" | `--[dendrogram w/ 2 branches and 26 members at h = 4.11] | |--[dendrogram w/ 2 branches and 9 members at h = 0.75] | | |--[dendrogram w/ 2 branches and 4 members at h = 0.531] | | | |--[dendrogram w/ 2 branches and 2 members at h = 0.134] | | | | |--leaf "45" | | | | `--leaf "57" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.234] | | | |--leaf "18" | | | `--leaf "42" | | `--[dendrogram w/ 2 branches and 5 members at h = 0.696] | | |--[dendrogram w/ 2 branches and 3 members at h = 0.226] | | | |--leaf "19" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.145] | | | |--leaf "7" | | | `--leaf "8" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.334] | | |--leaf "43" | | `--leaf "44" | `--[dendrogram w/ 2 branches and 17 members at h = 3.01] | |--[dendrogram w/ 2 branches and 7 members at h = 1.14] | | |--[dendrogram w/ 2 branches and 3 members at h = 0.244] | | | |--leaf "41" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.0768] | | | |--leaf "29" | | | `--leaf "30" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.824] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.317] | | | |--leaf "23" | | | `--leaf "46" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.36] | | |--leaf "17" | | `--leaf "22" | `--[dendrogram w/ 2 branches and 10 members at h = 1.52] | |--[dendrogram w/ 2 branches and 4 members at h = 0.253] | | |--leaf "81" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.156] | | |--leaf "80" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.0548] | | |--leaf "78" | | `--leaf "79" | `--[dendrogram w/ 2 branches and 6 members at h = 0.818] | |--[dendrogram w/ 2 branches and 2 members at h = 0.124] | | |--leaf "77" | | `--leaf "82" | `--[dendrogram w/ 2 branches and 4 members at h = 0.561] | |--[dendrogram w/ 2 branches and 2 members at h = 0.206] | | |--leaf "54" | | `--leaf "58" | `--[dendrogram w/ 2 branches and 2 members at h = 0.297] | |--leaf "66" | `--leaf "70" `--[dendrogram w/ 2 branches and 49 members at h = 18.3] |--[dendrogram w/ 2 branches and 12 members at h = 2.66] | |--[dendrogram w/ 2 branches and 4 members at h = 1.59] | | |--leaf "15" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.323] | | |--leaf "50" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.153] | | |--leaf "48" | | `--leaf "49" | `--[dendrogram w/ 2 branches and 8 members at h = 2.09] | |--[dendrogram w/ 2 branches and 5 members at h = 0.765] | | |--[dendrogram w/ 2 branches and 3 members at h = 0.389] | | | |--leaf "14" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.192] | | | |--leaf "25" | | | `--leaf "26" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.414] | | |--leaf "37" | | `--leaf "62" | `--[dendrogram w/ 2 branches and 3 members at h = 1.22] | |--leaf "13" | `--[dendrogram w/ 2 branches and 2 members at h = 0.604] | |--leaf "51" | `--leaf "73" `--[dendrogram w/ 2 branches and 37 members at h = 10.1] |--[dendrogram w/ 2 branches and 8 members at h = 1.9] | |--[dendrogram w/ 2 branches and 6 members at h = 0.636] | | |--[dendrogram w/ 2 branches and 3 members at h = 0.275] | | | |--leaf "64" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.199] | | | |--leaf "53" | | | `--leaf "65" | | `--[dendrogram w/ 2 branches and 3 members at h = 0.299] | | |--leaf "28" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.156] | | |--leaf "34" | | `--leaf "40" | `--[dendrogram w/ 2 branches and 2 members at h = 1.04] | |--leaf "16" | `--leaf "76" `--[dendrogram w/ 2 branches and 29 members at h = 5.21] |--[dendrogram w/ 2 branches and 10 members at h = 2.05] | |--[dendrogram w/ 2 branches and 5 members at h = 0.893] | | |--[dendrogram w/ 2 branches and 3 members at h = 0.521] | | | |--leaf "27" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.303] | | | |--leaf "5" | | | `--leaf "38" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.603] | | |--leaf "1" | | `--leaf "2" | `--[dendrogram w/ 2 branches and 5 members at h = 1.3] | |--[dendrogram w/ 2 branches and 2 members at h = 0.221] | | |--leaf "74" | | `--leaf "84" | `--[dendrogram w/ 2 branches and 3 members at h = 0.43] | |--leaf "61" | `--[dendrogram w/ 2 branches and 2 members at h = 0.211] | |--leaf "60" | `--leaf "72" `--[dendrogram w/ 2 branches and 19 members at h = 2.62] |--[dendrogram w/ 2 branches and 8 members at h = 1.10] | |--[dendrogram w/ 2 branches and 3 members at h = 0.246] | | |--leaf "63" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.171] | | |--leaf "75" | | `--leaf "83" | `--[dendrogram w/ 2 branches and 5 members at h = 0.672] | |--[dendrogram w/ 2 branches and 2 members at h = 0.318] | | |--leaf "59" | | `--leaf "67" | `--[dendrogram w/ 2 branches and 3 members at h = 0.447] | |--leaf "71" | `--[dendrogram w/ 2 branches and 2 members at h = 0.280] | |--leaf "47" | `--leaf "69" `--[dendrogram w/ 2 branches and 11 members at h = 1.70] |--[dendrogram w/ 2 branches and 4 members at h = 0.505] | |--leaf "4" | `--[dendrogram w/ 2 branches and 3 members at h = 0.386] | |--leaf "39" | `--[dendrogram w/ 2 branches and 2 members at h = 0.26] | |--leaf "33" | `--leaf "52" `--[dendrogram w/ 2 branches and 7 members at h = 0.828] |--[dendrogram w/ 2 branches and 3 members at h = 0.279] | |--leaf "36" | `--[dendrogram w/ 2 branches and 2 members at h = 0.217] | |--leaf "12" | `--leaf "24" `--[dendrogram w/ 2 branches and 4 members at h = 0.424] |--leaf "3" `--[dendrogram w/ 2 branches and 3 members at h = 0.22] |--leaf "35" `--[dendrogram w/ 2 branches and 2 members at h = 0.167] |--leaf "10" `--leaf "11" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1vxcr1226614823.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/2frez1226614823.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/34v2o1226614823.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/4jl9a1226614823.tab") + } > > system("convert tmp/1vxcr1226614823.ps tmp/1vxcr1226614823.png") > system("convert tmp/2frez1226614823.ps tmp/2frez1226614823.png") convert: unable to open image `tmp/2frez1226614823.ps': No such file or directory. convert: missing an image filename `tmp/2frez1226614823.png'. > > > proc.time() user system elapsed 0.889 0.237 0.991