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(3134.5 + ,2236 + ,3258.1 + ,3510.5 + ,2084.9 + ,3140.1 + ,4047.4 + ,2409.5 + ,3627.4 + ,3580.8 + ,2199.3 + ,3279.4 + ,3567.3 + ,2203.5 + ,3204 + ,3920.1 + ,2254.1 + ,3515.6 + ,3764.8 + ,1975.8 + ,3146.6 + ,3139.3 + ,1742.2 + ,2271.7 + ,4126.1 + ,2520.6 + ,3627.9 + ,3920 + ,2438.1 + ,3553.4 + ,3868.3 + ,2126.3 + ,3018.3 + ,3414 + ,2267.5 + ,3355.4 + ,3423.4 + ,2201.1 + ,3242 + ,3819 + ,2128.5 + ,3311.1 + ,4482.7 + ,2596 + ,4125.2 + ,4040.4 + ,2458.2 + ,3423 + ,3720.3 + ,2210.5 + ,3120.3 + ,4405 + ,2621.2 + ,3863 + ,3916.6 + ,2231.4 + ,3240.8 + ,3540.5 + ,2103.6 + ,2837.4 + ,4486.4 + ,2685.8 + ,3945 + ,4213.6 + ,2539.3 + ,3684.1 + ,4521.7 + ,2462.4 + ,3659.6 + ,4102.3 + ,2693.3 + ,3769.6 + ,3854.1 + ,2307.7 + ,3592.7 + ,4106.5 + ,2385.9 + ,3754 + ,4870.9 + ,2737.6 + ,4507.8 + ,4559.7 + ,2653.9 + ,3853.2 + ,4072.1 + ,2545.4 + ,3817.2 + ,4687.7 + ,2848.8 + ,3958.4 + ,4096.1 + ,2359.5 + ,3428.9 + ,4107.2 + ,2488.3 + ,3125.7 + ,4888 + ,2861.1 + ,3977 + ,4256.2 + ,2717.9 + ,3983.3 + ,4593.8 + ,2844 + ,4299.6 + ,3888.2 + ,2749 + ,4306.9 + ,4232.7 + ,2652.9 + ,4259.5 + ,4386.2 + ,2660.2 + ,3986 + ,5203.6 + ,3187.1 + ,4755.6 + ,4456.6 + ,2774.1 + ,3925.6 + ,4828.4 + ,3158.2 + ,4206.5 + ,5244.6 + ,3244.6 + ,4323.4 + ,4407.6 + ,2665.5 + ,3816.1 + ,4809.3 + ,2820.8 + ,3410.7 + ,5226.8 + ,2983.4 + ,4227.4 + ,5290.2 + ,3077.4 + ,4296.9 + ,5068.8 + ,3024.8 + ,4351.7 + ,4425.2 + ,2731.8 + ,3800 + ,4971 + ,3046.2 + ,4277 + ,4806.9 + ,2834.8 + ,4100.2 + ,5565.8 + ,3292.8 + ,4672.5 + ,4754.9 + ,2946.1 + ,4189.9 + ,5220 + ,3196.9 + ,4231.9 + ,5684.3 + ,3284.2 + ,4654.9 + ,4815.3 + ,3003 + ,4298.5 + ,5114.4 + ,2979 + ,3635.9 + ,5273.9 + ,3137.4 + ,4505.1 + ,5602.6 + ,3647.7 + ,4910.1 + ,5609.7 + ,3283 + ,4908.7 + ,4168.9 + ,2947.3 + ,4101.4) + ,dim=c(3 + ,60) + ,dimnames=list(c('Duitsland' + ,'Nederland' + ,'Frankrijk') + ,1:60)) > y <- array(NA,dim=c(3,60),dimnames=list(c('Duitsland','Nederland','Frankrijk'),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: 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 60 members at h = 24887] |--[dendrogram w/ 2 branches and 25 members at h = 5390] | |--[dendrogram w/ 2 branches and 12 members at h = 1100] | | |--[dendrogram w/ 2 branches and 6 members at h = 352] | | | |--[dendrogram w/ 2 branches and 2 members at h = 158] | | | | |--leaf "24" | | | | `--leaf "29" | | | `--[dendrogram w/ 2 branches and 4 members at h = 246] | | | |--[dendrogram w/ 2 branches and 2 members at h = 106] | | | | |--leaf "9" | | | | `--leaf "22" | | | `--[dendrogram w/ 2 branches and 2 members at h = 142] | | | |--leaf "3" | | | `--leaf "26" | | `--[dendrogram w/ 2 branches and 6 members at h = 598] | | |--[dendrogram w/ 2 branches and 3 members at h = 188] | | | |--leaf "10" | | | `--[dendrogram w/ 2 branches and 2 members at h = 115] | | | |--leaf "6" | | | `--leaf "25" | | `--[dendrogram w/ 2 branches and 3 members at h = 386] | | |--leaf "32" | | `--[dendrogram w/ 2 branches and 2 members at h = 113] | | |--leaf "16" | | `--leaf "31" | `--[dendrogram w/ 2 branches and 13 members at h = 1776] | |--leaf "8" | `--[dendrogram w/ 2 branches and 12 members at h = 1213] | |--[dendrogram w/ 2 branches and 6 members at h = 515] | | |--leaf "1" | | `--[dendrogram w/ 2 branches and 5 members at h = 293] | | |--[dendrogram w/ 2 branches and 2 members at h = 132] | | | |--leaf "12" | | | `--leaf "13" | | `--[dendrogram w/ 2 branches and 3 members at h = 201] | | |--leaf "2" | | `--[dendrogram w/ 2 branches and 2 members at h = 76.7] | | |--leaf "4" | | `--leaf "5" | `--[dendrogram w/ 2 branches and 6 members at h = 591] | |--leaf "20" | `--[dendrogram w/ 2 branches and 5 members at h = 349] | |--[dendrogram w/ 2 branches and 2 members at h = 158] | | |--leaf "14" | | `--leaf "19" | `--[dendrogram w/ 2 branches and 3 members at h = 243] | |--leaf "7" | `--[dendrogram w/ 2 branches and 2 members at h = 198] | |--leaf "11" | `--leaf "17" `--[dendrogram w/ 2 branches and 35 members at h = 9420] |--[dendrogram w/ 2 branches and 12 members at h = 2372] | |--[dendrogram w/ 2 branches and 4 members at h = 518] | | |--leaf "58" | | `--[dendrogram w/ 2 branches and 3 members at h = 297] | | |--leaf "59" | | `--[dendrogram w/ 2 branches and 2 members at h = 120] | | |--leaf "51" | | `--leaf "54" | `--[dendrogram w/ 2 branches and 8 members at h = 699] | |--[dendrogram w/ 2 branches and 2 members at h = 265] | | |--leaf "39" | | `--leaf "57" | `--[dendrogram w/ 2 branches and 6 members at h = 475] | |--[dendrogram w/ 2 branches and 2 members at h = 125] | | |--leaf "47" | | `--leaf "49" | `--[dendrogram w/ 2 branches and 4 members at h = 291] | |--[dendrogram w/ 2 branches and 2 members at h = 106] | | |--leaf "42" | | `--leaf "53" | `--[dendrogram w/ 2 branches and 2 members at h = 133] | |--leaf "45" | `--leaf "46" `--[dendrogram w/ 2 branches and 23 members at h = 3119] |--[dendrogram w/ 2 branches and 13 members at h = 1427] | |--[dendrogram w/ 2 branches and 3 members at h = 394] | | |--leaf "36" | | `--[dendrogram w/ 2 branches and 2 members at h = 340] | | |--leaf "37" | | `--leaf "60" | `--[dendrogram w/ 2 branches and 10 members at h = 517] | |--[dendrogram w/ 2 branches and 5 members at h = 283] | | |--leaf "15" | | `--[dendrogram w/ 2 branches and 4 members at h = 238] | | |--leaf "34" | | `--[dendrogram w/ 2 branches and 3 members at h = 140] | | |--leaf "38" | | `--[dendrogram w/ 2 branches and 2 members at h = 95.2] | | |--leaf "21" | | `--leaf "40" | `--[dendrogram w/ 2 branches and 5 members at h = 389] | |--leaf "23" | `--[dendrogram w/ 2 branches and 4 members at h = 196] | |--leaf "28" | `--[dendrogram w/ 2 branches and 3 members at h = 111] | |--leaf "48" | `--[dendrogram w/ 2 branches and 2 members at h = 64.6] | |--leaf "18" | `--leaf "43" `--[dendrogram w/ 2 branches and 10 members at h = 1577] |--[dendrogram w/ 2 branches and 2 members at h = 411] | |--leaf "44" | `--leaf "56" `--[dendrogram w/ 2 branches and 8 members at h = 686] |--[dendrogram w/ 2 branches and 3 members at h = 208] | |--leaf "30" | `--[dendrogram w/ 2 branches and 2 members at h = 150] | |--leaf "33" | `--leaf "50" `--[dendrogram w/ 2 branches and 5 members at h = 505] |--leaf "27" `--[dendrogram w/ 2 branches and 4 members at h = 357] |--leaf "35" `--[dendrogram w/ 2 branches and 3 members at h = 225] |--leaf "41" `--[dendrogram w/ 2 branches and 2 members at h = 137] |--leaf "52" `--leaf "55" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1ko8q1226415718.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/2z2re1226415718.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/3ghoo1226415718.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/4jk1e1226415719.tab") + } > > system("convert tmp/1ko8q1226415718.ps tmp/1ko8q1226415718.png") > system("convert tmp/2z2re1226415718.ps tmp/2z2re1226415718.png") convert: unable to open image `tmp/2z2re1226415718.ps': No such file or directory. convert: missing an image filename `tmp/2z2re1226415718.png'. > > > proc.time() user system elapsed 0.767 0.200 0.870