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(2333.3 + ,117 + ,2894.3 + ,3118.6 + ,2282.2 + ,122.2 + ,2838.1 + ,3089.8 + ,2458.2 + ,116.8 + ,3137.7 + ,3312.3 + ,2345.5 + ,115 + ,2703.7 + ,3106.1 + ,2065.2 + ,105.3 + ,2623.6 + ,2843.1 + ,2332.5 + ,114.1 + ,2691.1 + ,3300.4 + ,2077.5 + ,102.1 + ,2577.9 + ,3147.9 + ,1691.4 + ,91 + ,2430.5 + ,2742.7 + ,2381.9 + ,123.2 + ,2871 + ,3397.3 + ,2526 + ,125.8 + ,2922.5 + ,3461.4 + ,2212.1 + ,108.1 + ,2810.8 + ,3314.8 + ,2459.9 + ,117.2 + ,3070.3 + ,3248 + ,2178.8 + ,111 + ,2790 + ,2938 + ,2318.2 + ,114.5 + ,2821 + ,3473.8 + ,2661.8 + ,141.9 + ,3383.6 + ,3839.1 + ,2407.9 + ,135.5 + ,3038.4 + ,3601.9 + ,2040.6 + ,128.3 + ,2877.3 + ,3173.2 + ,2601.6 + ,142.7 + ,3283.7 + ,3938.3 + ,2106.3 + ,135.4 + ,2927.3 + ,3034.2 + ,1829.9 + ,174.3 + ,2952.5 + ,2900.5 + ,2546.1 + ,186 + ,3328.9 + ,4236.3 + ,2363 + ,154.9 + ,3467.3 + ,3433.4 + ,2435.8 + ,146.2 + ,3355.6 + ,3777.8 + ,2668 + ,135.9 + ,3707 + ,3709.8 + ,2316.9 + ,118 + ,3275.6 + ,3192.8 + ,2324.2 + ,113.3 + ,3466.5 + ,3640.2 + ,2610.8 + ,138 + ,4054.3 + ,4275.3 + ,2413.2 + ,138 + ,3708.5 + ,3708.9 + ,2345.2 + ,116.7 + ,3339 + ,3312.1 + ,2590.8 + ,303 + ,3559.8 + ,3948 + ,2132.1 + ,111.6 + ,3189.2 + ,3084.8 + ,1990.7 + ,110.1 + ,3620.7 + ,3412.8 + ,2641.7 + ,132.8 + ,3915.4 + ,4036.3 + ,2437.1 + ,133.2 + ,3804.3 + ,3608.7 + ,2649.2 + ,135.9 + ,4391.6 + ,3911.8 + ,2819.4 + ,153.7 + ,4975.9 + ,3857.3 + ,2405.6 + ,132.7 + ,4478.7 + ,3567.3 + ,2451.3 + ,141.1 + ,4455.8 + ,4022.2 + ,2878.5 + ,168 + ,5661.8 + ,4948.6 + ,2534.1 + ,136 + ,4062.8 + ,3645 + ,2670.6 + ,134.7 + ,4257.7 + ,3982.5 + ,2909.7 + ,146.4 + ,4114.2 + ,4175.4 + ,2261.8 + ,135.5 + ,3793.8 + ,3660.9 + ,2135.3 + ,134.8 + ,4170 + ,4019.7 + ,2870.4 + ,145 + ,4004.9 + ,4447.6 + ,2803.2 + ,156.4 + ,4129.7 + ,4211.6 + ,2775.1 + ,161.7 + ,4116 + ,4252.3 + ,2633.7 + ,144.1 + ,4133.8 + ,3703.1 + ,2930.6 + ,147.7 + ,4081.2 + ,4052.1 + ,2779.7 + ,152.2 + ,3854.1 + ,4462 + ,3039.2 + ,170.7 + ,4239.8 + ,4862.6 + ,2752.7 + ,225.8 + ,3718.5 + ,4114.4 + ,2743.1 + ,151.3 + ,4183.1 + ,4630.4 + ,2914 + ,162.3 + ,4336.1 + ,4694.1 + ,2711.9 + ,132.6 + ,4299.2 + ,4189.4 + ,2295.8 + ,130.1 + ,4285.3 + ,4158 + ,2840.6 + ,149.1 + ,4676.7 + ,4533.8 + ,3230.5 + ,340.7 + ,4980.6 + ,4906.2 + ,2761.1 + ,243.4 + ,5207.4 + ,4858.8 + ,2769.6 + ,238.1 + ,5221.7 + ,4059) + ,dim=c(4 + ,60) + ,dimnames=list(c('Frankrijk' + ,'Luxemburg' + ,'Nederland' + ,'Duitsland') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('Frankrijk','Luxemburg','Nederland','Duitsland'),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 = 26961] |--[dendrogram w/ 2 branches and 23 members at h = 2815] | |--[dendrogram w/ 2 branches and 11 members at h = 997] | | |--leaf "8" | | `--[dendrogram w/ 2 branches and 10 members at h = 783] | | |--[dendrogram w/ 2 branches and 4 members at h = 420] | | | |--leaf "20" | | | `--[dendrogram w/ 2 branches and 3 members at h = 350] | | | |--leaf "31" | | | `--[dendrogram w/ 2 branches and 2 members at h = 162] | | | |--leaf "17" | | | `--leaf "19" | | `--[dendrogram w/ 2 branches and 6 members at h = 578] | | |--[dendrogram w/ 2 branches and 3 members at h = 200] | | | |--leaf "4" | | | `--[dendrogram w/ 2 branches and 2 members at h = 81.4] | | | |--leaf "1" | | | `--leaf "2" | | `--[dendrogram w/ 2 branches and 3 members at h = 342] | | |--leaf "7" | | `--[dendrogram w/ 2 branches and 2 members at h = 223] | | |--leaf "5" | | `--leaf "13" | `--[dendrogram w/ 2 branches and 12 members at h = 1710] | |--[dendrogram w/ 2 branches and 4 members at h = 591] | | |--leaf "32" | | `--[dendrogram w/ 2 branches and 3 members at h = 284] | | |--leaf "22" | | `--[dendrogram w/ 2 branches and 2 members at h = 138] | | |--leaf "25" | | `--leaf "29" | `--[dendrogram w/ 2 branches and 8 members at h = 711] | |--[dendrogram w/ 2 branches and 4 members at h = 268] | | |--[dendrogram w/ 2 branches and 2 members at h = 112] | | | |--leaf "9" | | | `--leaf "14" | | `--[dendrogram w/ 2 branches and 2 members at h = 170] | | |--leaf "6" | | `--leaf "11" | `--[dendrogram w/ 2 branches and 4 members at h = 449] | |--[dendrogram w/ 2 branches and 2 members at h = 93.2] | | |--leaf "3" | | `--leaf "12" | `--[dendrogram w/ 2 branches and 2 members at h = 217] | |--leaf "10" | `--leaf "16" `--[dendrogram w/ 2 branches and 37 members at h = 7694] |--[dendrogram w/ 2 branches and 12 members at h = 1180] | |--[dendrogram w/ 2 branches and 5 members at h = 620] | | |--[dendrogram w/ 2 branches and 2 members at h = 212] | | | |--leaf "23" | | | `--leaf "26" | | `--[dendrogram w/ 2 branches and 3 members at h = 435] | | |--leaf "21" | | `--[dendrogram w/ 2 branches and 2 members at h = 153] | | |--leaf "15" | | `--leaf "18" | `--[dendrogram w/ 2 branches and 7 members at h = 964] | |--[dendrogram w/ 2 branches and 3 members at h = 195] | | |--leaf "43" | | `--[dendrogram w/ 2 branches and 2 members at h = 141] | | |--leaf "28" | | `--leaf "34" | `--[dendrogram w/ 2 branches and 4 members at h = 459] | |--[dendrogram w/ 2 branches and 2 members at h = 257] | | |--leaf "33" | | `--leaf "52" | `--[dendrogram w/ 2 branches and 2 members at h = 335] | |--leaf "24" | `--leaf "30" `--[dendrogram w/ 2 branches and 25 members at h = 5039] |--[dendrogram w/ 2 branches and 5 members at h = 1826] | |--[dendrogram w/ 2 branches and 2 members at h = 333] | | |--leaf "36" | | `--leaf "60" | `--[dendrogram w/ 2 branches and 3 members at h = 718] | |--leaf "58" | `--[dendrogram w/ 2 branches and 2 members at h = 484] | |--leaf "39" | `--leaf "59" `--[dendrogram w/ 2 branches and 20 members at h = 3307] |--[dendrogram w/ 2 branches and 8 members at h = 925] | |--[dendrogram w/ 2 branches and 3 members at h = 540] | | |--leaf "37" | | `--[dendrogram w/ 2 branches and 2 members at h = 136] | | |--leaf "40" | | `--leaf "48" | `--[dendrogram w/ 2 branches and 5 members at h = 739] | |--[dendrogram w/ 2 branches and 2 members at h = 241] | | |--leaf "44" | | `--leaf "56" | `--[dendrogram w/ 2 branches and 3 members at h = 305] | |--leaf "38" | `--[dendrogram w/ 2 branches and 2 members at h = 153] | |--leaf "35" | `--leaf "41" `--[dendrogram w/ 2 branches and 12 members at h = 1704] |--[dendrogram w/ 2 branches and 4 members at h = 597] | |--leaf "57" | `--[dendrogram w/ 2 branches and 3 members at h = 336] | |--leaf "53" | `--[dendrogram w/ 2 branches and 2 members at h = 231] | |--leaf "51" | `--leaf "54" `--[dendrogram w/ 2 branches and 8 members at h = 696] |--[dendrogram w/ 2 branches and 2 members at h = 177] | |--leaf "45" | `--leaf "50" `--[dendrogram w/ 2 branches and 6 members at h = 412] |--[dendrogram w/ 2 branches and 2 members at h = 129] | |--leaf "42" | `--leaf "49" `--[dendrogram w/ 2 branches and 4 members at h = 265] |--leaf "55" `--[dendrogram w/ 2 branches and 3 members at h = 247] |--leaf "27" `--[dendrogram w/ 2 branches and 2 members at h = 51.6] |--leaf "46" `--leaf "47" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1zmk51226409865.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/2x6ja1226409865.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/34cl01226409865.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/4qfsy1226409865.tab") + } > > system("convert tmp/1zmk51226409865.ps tmp/1zmk51226409865.png") > system("convert tmp/2x6ja1226409865.ps tmp/2x6ja1226409865.png") convert: unable to open image `tmp/2x6ja1226409865.ps': No such file or directory. convert: missing an image filename `tmp/2x6ja1226409865.png'. > > > proc.time() user system elapsed 0.769 0.194 0.893