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(94.71,93.77,95.73,95.99,95.82,95.47,95.82,94.71,96.33,96.5,96.16,96.33,96.33,95.05,96.84,96.92,97.44,97.78,97.69,96.67,98.29,98.2,98.71,98.54,98.2,96.92,99.06,99.65,99.82,99.99,100.33,99.31,101.1,101.1,100.93,100.85,100.93,99.6,101.88,101.81,102.38,102.74,102.82,101.72,103.47,102.98,102.68,102.9,103.03,101.29,103.69,103.68,104.2,104.08,104.16,103.05,104.66,104.46,104.95,105.85,106.23),dim=c(1,61),dimnames=list(c('inflatie'),1:61)) > y <- array(NA,dim=c(1,61),dimnames=list(c('inflatie'),1:61)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = 'FALSE' > par3 = 'FALSE' > par2 = 'ALL' > par1 = 'ward' > ylab = '' > xlab = '' > main = '' > #'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 61 members at h = 99.8] |--[dendrogram w/ 2 branches and 19 members at h = 10.2] | |--[dendrogram w/ 2 branches and 8 members at h = 0.773] | | |--[dendrogram w/ 2 branches and 3 members at h = 0.0733] | | | |--leaf "46" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0.02] | | | |--leaf "49" | | | `--leaf "56" | | `--[dendrogram w/ 2 branches and 5 members at h = 0.574] | | |--leaf "41" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.23] | | |--[dendrogram w/ 2 branches and 2 members at h = 0.06] | | | |--leaf "42" | | | `--leaf "47" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.08] | | |--leaf "43" | | `--leaf "48" | `--[dendrogram w/ 2 branches and 11 members at h = 5.02] | |--[dendrogram w/ 2 branches and 2 members at h = 0.38] | | |--leaf "60" | | `--leaf "61" | `--[dendrogram w/ 2 branches and 9 members at h = 2.35] | |--[dendrogram w/ 2 branches and 3 members at h = 0.283] | | |--leaf "45" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.01] | | |--leaf "51" | | `--leaf "52" | `--[dendrogram w/ 2 branches and 6 members at h = 1.22] | |--[dendrogram w/ 2 branches and 3 members at h = 0.12] | | |--leaf "54" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.04] | | |--leaf "53" | | `--leaf "55" | `--[dendrogram w/ 2 branches and 3 members at h = 0.453] | |--leaf "59" | `--[dendrogram w/ 2 branches and 2 members at h = 0.2] | |--leaf "57" | `--leaf "58" `--[dendrogram w/ 2 branches and 42 members at h = 53.5] |--[dendrogram w/ 2 branches and 18 members at h = 7.69] | |--[dendrogram w/ 2 branches and 5 members at h = 1.68] | | |--leaf "2" | | `--[dendrogram w/ 2 branches and 4 members at h = 0.89] | | |--[dendrogram w/ 2 branches and 2 members at h = 0] | | | |--leaf "1" | | | `--leaf "8" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.42] | | |--leaf "6" | | `--leaf "14" | `--[dendrogram w/ 2 branches and 13 members at h = 3] | |--[dendrogram w/ 2 branches and 5 members at h = 0.595] | | |--[dendrogram w/ 2 branches and 3 members at h = 0.107] | | | |--leaf "15" | | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | | |--leaf "16" | | | `--leaf "26" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.17] | | |--leaf "10" | | `--leaf "20" | `--[dendrogram w/ 2 branches and 8 members at h = 1.31] | |--[dendrogram w/ 2 branches and 3 members at h = 0.12] | | |--leaf "3" | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | |--leaf "5" | | `--leaf "7" | `--[dendrogram w/ 2 branches and 5 members at h = 0.51] | |--[dendrogram w/ 2 branches and 3 members at h = 0] | | |--leaf "13" | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | |--leaf "9" | | `--leaf "12" | `--[dendrogram w/ 2 branches and 2 members at h = 0.17] | |--leaf "4" | `--leaf "11" `--[dendrogram w/ 2 branches and 24 members at h = 19.5] |--[dendrogram w/ 2 branches and 9 members at h = 2.62] | |--[dendrogram w/ 2 branches and 3 members at h = 0.143] | | |--leaf "44" | | `--[dendrogram w/ 2 branches and 2 members at h = 0.07] | | |--leaf "39" | | `--leaf "40" | `--[dendrogram w/ 2 branches and 6 members at h = 0.6] | |--[dendrogram w/ 2 branches and 3 members at h = 0.107] | | |--leaf "36" | | `--[dendrogram w/ 2 branches and 2 members at h = 0] | | |--leaf "35" | | `--leaf "37" | `--[dendrogram w/ 2 branches and 3 members at h = 0.253] | |--leaf "50" | `--[dendrogram w/ 2 branches and 2 members at h = 0] | |--leaf "33" | `--leaf "34" `--[dendrogram w/ 2 branches and 15 members at h = 8.4] |--[dendrogram w/ 2 branches and 7 members at h = 1.39] | |--[dendrogram w/ 2 branches and 2 members at h = 0.25] | | |--leaf "27" | | `--leaf "32" | `--[dendrogram w/ 2 branches and 5 members at h = 0.77] | |--leaf "31" | `--[dendrogram w/ 2 branches and 4 members at h = 0.45] | |--[dendrogram w/ 2 branches and 2 members at h = 0.05] | | |--leaf "28" | | `--leaf "38" | `--[dendrogram w/ 2 branches and 2 members at h = 0.17] | |--leaf "29" | `--leaf "30" `--[dendrogram w/ 2 branches and 8 members at h = 2.13] |--[dendrogram w/ 2 branches and 3 members at h = 0.363] | |--leaf "17" | `--[dendrogram w/ 2 branches and 2 members at h = 0.09] | |--leaf "18" | `--leaf "19" `--[dendrogram w/ 2 branches and 5 members at h = 0.798] |--[dendrogram w/ 2 branches and 3 members at h = 0.12] | |--leaf "21" | `--[dendrogram w/ 2 branches and 2 members at h = 0] | |--leaf "22" | `--leaf "25" `--[dendrogram w/ 2 branches and 2 members at h = 0.17] |--leaf "23" `--leaf "24" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1xj6q1226425354.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/2ftur1226425354.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/3hrt91226425354.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/4blg11226425354.tab") + } > > system("convert tmp/1xj6q1226425354.ps tmp/1xj6q1226425354.png") > system("convert tmp/2ftur1226425354.ps tmp/2ftur1226425354.png") convert: unable to open image `tmp/2ftur1226425354.ps': No such file or directory. convert: missing an image filename `tmp/2ftur1226425354.png'. > > > proc.time() user system elapsed 0.763 0.187 0.864