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(11947.20 + ,3423.40 + ,12300.00 + ,11714.10 + ,3242.80 + ,12092.80 + ,12192.50 + ,3277.20 + ,12380.80 + ,11268.80 + ,3833.00 + ,12196.90 + ,9097.40 + ,2606.30 + ,9455.00 + ,12639.80 + ,3643.80 + ,13168.00 + ,13040.10 + ,3686.40 + ,13427.90 + ,11687.30 + ,3281.60 + ,11980.50 + ,11191.70 + ,3669.30 + ,11884.80 + ,11391.90 + ,3191.50 + ,11691.70 + ,11793.10 + ,3512.70 + ,12233.80 + ,13933.20 + ,3970.70 + ,14341.40 + ,12778.10 + ,3601.20 + ,13130.70 + ,11810.30 + ,3610.00 + ,12421.10 + ,13698.40 + ,4172.10 + ,14285.80 + ,11956.60 + ,3956.20 + ,12864.60 + ,10723.80 + ,3142.70 + ,11160.20 + ,13938.90 + ,3884.30 + ,14316.20 + ,13979.80 + ,3892.20 + ,14388.70 + ,13807.40 + ,3613.00 + ,14013.90 + ,12973.90 + ,3730.50 + ,13419.00 + ,12509.80 + ,3481.30 + ,12769.60 + ,12934.10 + ,3649.50 + ,13315.50 + ,14908.30 + ,4215.20 + ,15332.90 + ,13772.10 + ,4066.60 + ,14243.00 + ,13012.60 + ,4196.80 + ,13824.40 + ,14049.90 + ,4536.60 + ,14962.90 + ,11816.50 + ,4441.60 + ,13202.90 + ,11593.20 + ,3548.30 + ,12199.00 + ,14466.20 + ,4735.90 + ,15508.90 + ,13615.90 + ,4130.60 + ,14199.80 + ,14733.90 + ,4356.20 + ,15169.60 + ,13880.70 + ,4159.60 + ,14058.00 + ,13527.50 + ,3988.00 + ,13786.20 + ,13584.00 + ,4167.80 + ,14147.90 + ,16170.20 + ,4902.20 + ,16541.70 + ,13260.60 + ,3909.40 + ,13587.50 + ,14741.90 + ,4697.60 + ,15582.40 + ,15486.50 + ,4308.90 + ,15802.80 + ,13154.50 + ,4420.40 + ,14130.50 + ,12621.20 + ,3544.20 + ,12923.20 + ,15031.60 + ,4433.00 + ,15612.20 + ,15452.40 + ,4479.70 + ,16033.70 + ,15428.00 + ,4533.20 + ,16036.60 + ,13105.90 + ,4237.50 + ,14037.80 + ,14716.80 + ,4207.40 + ,15330.60 + ,14180.00 + ,4394.00 + ,15038.30 + ,16202.20 + ,5148.40 + ,17401.80 + ,14392.40 + ,4202.20 + ,14992.50 + ,15140.60 + ,4682.50 + ,16043.70 + ,15960.10 + ,4884.30 + ,16929.60 + ,14351.30 + ,5288.90 + ,15921.30 + ,13230.20 + ,4505.20 + ,14417.20 + ,15202.10 + ,4611.50 + ,15961.00 + ,17157.30 + ,5081.10 + ,17851.90 + ,16159.10 + ,4523.10 + ,16483.90 + ,13405.70 + ,4412.80 + ,14215.50 + ,17224.70 + ,4647.40 + ,17429.70 + ,17338.40 + ,4778.60 + ,17839.50 + ,17370.60 + ,4495.30 + ,17629.20) + ,dim=c(3 + ,60) + ,dimnames=list(c('extraEu' + ,'IntraEU' + ,'Vlaanderen') + ,1:60)) > y <- array(NA,dim=c(3,60),dimnames=list(c('extraEu','IntraEU','Vlaanderen'),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 = 72382] |--[dendrogram w/ 2 branches and 23 members at h = 14286] | |--[dendrogram w/ 2 branches and 4 members at h = 714] | | |--[dendrogram w/ 2 branches and 2 members at h = 290] | | | |--leaf "58" | | | `--leaf "60" | | `--[dendrogram w/ 2 branches and 2 members at h = 353] | | |--leaf "55" | | `--leaf "59" | `--[dendrogram w/ 2 branches and 19 members at h = 8441] | |--[dendrogram w/ 2 branches and 10 members at h = 1968] | | |--[dendrogram w/ 2 branches and 3 members at h = 444] | | | |--leaf "49" | | | `--[dendrogram w/ 2 branches and 2 members at h = 207] | | | |--leaf "27" | | | `--leaf "47" | | `--[dendrogram w/ 2 branches and 7 members at h = 1626] | | |--[dendrogram w/ 2 branches and 4 members at h = 582] | | | |--leaf "42" | | | `--[dendrogram w/ 2 branches and 3 members at h = 268] | | | |--leaf "32" | | | `--[dendrogram w/ 2 branches and 2 members at h = 192] | | | |--leaf "24" | | | `--leaf "46" | | `--[dendrogram w/ 2 branches and 3 members at h = 894] | | |--leaf "52" | | `--[dendrogram w/ 2 branches and 2 members at h = 288] | | |--leaf "30" | | `--leaf "38" | `--[dendrogram w/ 2 branches and 9 members at h = 3965] | |--[dendrogram w/ 2 branches and 5 members at h = 643] | | |--[dendrogram w/ 2 branches and 2 members at h = 125] | | | |--leaf "50" | | | `--leaf "54" | | `--[dendrogram w/ 2 branches and 3 members at h = 393] | | |--leaf "39" | | `--[dendrogram w/ 2 branches and 2 members at h = 58.9] | | |--leaf "43" | | `--leaf "44" | `--[dendrogram w/ 2 branches and 4 members at h = 1061] | |--leaf "48" | `--[dendrogram w/ 2 branches and 3 members at h = 571] | |--leaf "51" | `--[dendrogram w/ 2 branches and 2 members at h = 384] | |--leaf "36" | `--leaf "56" `--[dendrogram w/ 2 branches and 37 members at h = 29735] |--[dendrogram w/ 2 branches and 19 members at h = 4208] | |--[dendrogram w/ 2 branches and 9 members at h = 1090] | | |--[dendrogram w/ 2 branches and 5 members at h = 363] | | | |--leaf "33" | | | `--[dendrogram w/ 2 branches and 4 members at h = 253] | | | |--[dendrogram w/ 2 branches and 2 members at h = 71.4] | | | | |--leaf "31" | | | | `--leaf "35" | | | `--[dendrogram w/ 2 branches and 2 members at h = 136] | | | |--leaf "15" | | | `--leaf "25" | | `--[dendrogram w/ 2 branches and 4 members at h = 667] | | |--leaf "20" | | `--[dendrogram w/ 2 branches and 3 members at h = 101] | | |--leaf "12" | | `--[dendrogram w/ 2 branches and 2 members at h = 83.6] | | |--leaf "18" | | `--leaf "19" | `--[dendrogram w/ 2 branches and 10 members at h = 2832] | |--[dendrogram w/ 2 branches and 5 members at h = 700] | | |--[dendrogram w/ 2 branches and 2 members at h = 283] | | | |--leaf "53" | | | `--leaf "57" | | `--[dendrogram w/ 2 branches and 3 members at h = 357] | | |--leaf "26" | | `--[dendrogram w/ 2 branches and 2 members at h = 211] | | |--leaf "40" | | `--leaf "45" | `--[dendrogram w/ 2 branches and 5 members at h = 1073] | |--[dendrogram w/ 2 branches and 3 members at h = 171] | | |--leaf "23" | | `--[dendrogram w/ 2 branches and 2 members at h = 80] | | |--leaf "7" | | `--leaf "21" | `--[dendrogram w/ 2 branches and 2 members at h = 342] | |--leaf "34" | `--leaf "37" `--[dendrogram w/ 2 branches and 18 members at h = 6947] |--[dendrogram w/ 2 branches and 6 members at h = 2025] | |--[dendrogram w/ 2 branches and 4 members at h = 548] | | |--[dendrogram w/ 2 branches and 2 members at h = 149] | | | |--leaf "6" | | | `--leaf "13" | | `--[dendrogram w/ 2 branches and 2 members at h = 200] | | |--leaf "22" | | `--leaf "41" | `--[dendrogram w/ 2 branches and 2 members at h = 608] | |--leaf "16" | `--leaf "28" `--[dendrogram w/ 2 branches and 12 members at h = 6161] |--leaf "5" `--[dendrogram w/ 2 branches and 11 members at h = 2112] |--leaf "17" `--[dendrogram w/ 2 branches and 10 members at h = 1447] |--[dendrogram w/ 2 branches and 5 members at h = 632] | |--leaf "3" | `--[dendrogram w/ 2 branches and 4 members at h = 345] | |--leaf "29" | `--[dendrogram w/ 2 branches and 3 members at h = 252] | |--leaf "14" | `--[dendrogram w/ 2 branches and 2 members at h = 190] | |--leaf "1" | `--leaf "11" `--[dendrogram w/ 2 branches and 5 members at h = 1178] |--[dendrogram w/ 2 branches and 2 members at h = 361] | |--leaf "4" | `--leaf "9" `--[dendrogram w/ 2 branches and 3 members at h = 586] |--leaf "10" `--[dendrogram w/ 2 branches and 2 members at h = 122] |--leaf "2" `--leaf "8" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/17xzw1226424802.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/2vzmm1226424802.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/3xpmo1226424802.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/4t7l31226424802.tab") + } > > system("convert tmp/17xzw1226424802.ps tmp/17xzw1226424802.png") > system("convert tmp/2vzmm1226424802.ps tmp/2vzmm1226424802.png") convert: unable to open image `tmp/2vzmm1226424802.ps': No such file or directory. convert: missing an image filename `tmp/2vzmm1226424802.png'. > > > proc.time() user system elapsed 0.795 0.185 0.900