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(1515 + ,2718 + ,524944 + ,292792 + ,1510 + ,2646 + ,568106 + ,318530 + ,1225 + ,2551 + ,484506 + ,276807 + ,1577 + ,2712 + ,512235 + ,284524 + ,1417 + ,2606 + ,523179 + ,290486 + ,1224 + ,2365 + ,462411 + ,259355 + ,1693 + ,3533 + ,685872 + ,383556 + ,1633 + ,3509 + ,635902 + ,350488 + ,1639 + ,2912 + ,573599 + ,318029 + ,1914 + ,3599 + ,668826 + ,377740 + ,1586 + ,2719 + ,520868 + ,293546 + ,1552 + ,2869 + ,555680 + ,317460 + ,2081 + ,4085 + ,727941 + ,401629 + ,1500 + ,2686 + ,516959 + ,282854 + ,1437 + ,2545 + ,489975 + ,275316 + ,1470 + ,3071 + ,559687 + ,304680 + ,1849 + ,3388 + ,630947 + ,349947 + ,1387 + ,2652 + ,473994 + ,266543 + ,1592 + ,3190 + ,583802 + ,329195 + ,1589 + ,2884 + ,553061 + ,314626 + ,1798 + ,3295 + ,604700 + ,338463 + ,1935 + ,3818 + ,708101 + ,399338 + ,1887 + ,3226 + ,617053 + ,339542 + ,2027 + ,3953 + ,819858 + ,454688 + ,2080 + ,3810 + ,736520 + ,396766 + ,1556 + ,2877 + ,567696 + ,309465 + ,1682 + ,3515 + ,666627 + ,365707 + ,1785 + ,3708 + ,701749 + ,383677 + ,1869 + ,3450 + ,647394 + ,352609 + ,1781 + ,3360 + ,610231 + ,340011 + ,2082 + ,4110 + ,777555 + ,425915 + ,2570 + ,4384 + ,901319 + ,498938 + ,1862 + ,3729 + ,707164 + ,391142 + ,1936 + ,4263 + ,782859 + ,418962 + ,1504 + ,3505 + ,652556 + ,342378 + ,1765 + ,3674 + ,676064 + ,369674 + ,1607 + ,3911 + ,707665 + ,391250 + ,1577 + ,2951 + ,561515 + ,310589 + ,1493 + ,3317 + ,645794 + ,335910 + ,1615 + ,3417 + ,623482 + ,344448 + ,1700 + ,3498 + ,673401 + ,361944 + ,1335 + ,2768 + ,544890 + ,290274 + ,1523 + ,2899 + ,605125 + ,327902 + ,1623 + ,3179 + ,608393 + ,330268 + ,1540 + ,3011 + ,579718 + ,324957 + ,1637 + ,3481 + ,647499 + ,350780 + ,1524 + ,3015 + ,575016 + ,320017 + ,1419 + ,2606 + ,510096 + ,278970 + ,1821 + ,3530 + ,697835 + ,383097 + ,1593 + ,2827 + ,561177 + ,301300 + ,1357 + ,3120 + ,584949 + ,318259 + ,1263 + ,2557 + ,516723 + ,266891 + ,1750 + ,3645 + ,695323 + ,384327 + ,1405 + ,2865 + ,548018 + ,294991 + ,1393 + ,2587 + ,497706 + ,267257 + ,1639 + ,2887 + ,559796 + ,310886 + ,1679 + ,3429 + ,669449 + ,359118 + ,1551 + ,2956 + ,583301 + ,314124 + ,1744 + ,3098 + ,626790 + ,340377 + ,1429 + ,2934 + ,580268 + ,309894 + ,1784 + ,3269 + ,649016 + ,353873) + ,dim=c(4 + ,61) + ,dimnames=list(c('x1' + ,'x2' + ,'x3' + ,'x4') + ,1:61)) > y <- array(NA,dim=c(4,61),dimnames=list(c('x1','x2','x3','x4'),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 = 2946281] |--[dendrogram w/ 2 branches and 29 members at h = 713659] | |--[dendrogram w/ 2 branches and 17 members at h = 131591] | | |--[dendrogram w/ 2 branches and 8 members at h = 25485] | | | |--[dendrogram w/ 2 branches and 3 members at h = 8377] | | | | |--leaf "60" | | | | `--[dendrogram w/ 2 branches and 2 members at h = 4459] | | | | |--leaf "51" | | | | `--leaf "58" | | | `--[dendrogram w/ 2 branches and 5 members at h = 22919] | | | |--[dendrogram w/ 2 branches and 2 members at h = 5889] | | | | |--leaf "19" | | | | `--leaf "45" | | | `--[dendrogram w/ 2 branches and 3 members at h = 7586] | | | |--leaf "2" | | | `--[dendrogram w/ 2 branches and 2 members at h = 2446] | | | |--leaf "9" | | | `--leaf "47" | | `--[dendrogram w/ 2 branches and 9 members at h = 53198] | | |--[dendrogram w/ 2 branches and 2 members at h = 5661] | | | |--leaf "42" | | | `--leaf "54" | | `--[dendrogram w/ 2 branches and 7 members at h = 23943] | | |--[dendrogram w/ 2 branches and 2 members at h = 3859] | | | |--leaf "12" | | | `--leaf "20" | | `--[dendrogram w/ 2 branches and 5 members at h = 13960] | | |--[dendrogram w/ 2 branches and 2 members at h = 3704] | | | |--leaf "16" | | | `--leaf "50" | | `--[dendrogram w/ 2 branches and 3 members at h = 8958] | | |--leaf "26" | | `--[dendrogram w/ 2 branches and 2 members at h = 1747] | | |--leaf "38" | | `--leaf "56" | `--[dendrogram w/ 2 branches and 12 members at h = 154657] | |--[dendrogram w/ 2 branches and 7 members at h = 41122] | | |--[dendrogram w/ 2 branches and 3 members at h = 4355] | | | |--leaf "11" | | | `--[dendrogram w/ 2 branches and 2 members at h = 2908] | | | |--leaf "1" | | | `--leaf "5" | | `--[dendrogram w/ 2 branches and 4 members at h = 20830] | | |--leaf "52" | | `--[dendrogram w/ 2 branches and 3 members at h = 7557] | | |--leaf "48" | | `--[dendrogram w/ 2 branches and 2 members at h = 5011] | | |--leaf "4" | | `--leaf "14" | `--[dendrogram w/ 2 branches and 5 members at h = 44113] | |--[dendrogram w/ 2 branches and 2 members at h = 13636] | | |--leaf "6" | | `--leaf "18" | `--[dendrogram w/ 2 branches and 3 members at h = 16417] | |--leaf "55" | `--[dendrogram w/ 2 branches and 2 members at h = 5673] | |--leaf "3" | `--leaf "15" `--[dendrogram w/ 2 branches and 32 members at h = 1055511] |--[dendrogram w/ 2 branches and 19 members at h = 270035] | |--[dendrogram w/ 2 branches and 9 members at h = 67642] | | |--[dendrogram w/ 2 branches and 4 members at h = 16426] | | | |--[dendrogram w/ 2 branches and 2 members at h = 4046] | | | | |--leaf "43" | | | | `--leaf "44" | | | `--[dendrogram w/ 2 branches and 2 members at h = 5744] | | | |--leaf "21" | | | `--leaf "30" | | `--[dendrogram w/ 2 branches and 5 members at h = 25359] | | |--[dendrogram w/ 2 branches and 2 members at h = 4991] | | | |--leaf "8" | | | `--leaf "17" | | `--[dendrogram w/ 2 branches and 3 members at h = 10160] | | |--leaf "23" | | `--[dendrogram w/ 2 branches and 2 members at h = 5257] | | |--leaf "40" | | `--leaf "59" | `--[dendrogram w/ 2 branches and 10 members at h = 112299] | |--[dendrogram w/ 2 branches and 5 members at h = 19500] | | |--[dendrogram w/ 2 branches and 3 members at h = 8325] | | | |--leaf "27" | | | `--[dendrogram w/ 2 branches and 2 members at h = 4859] | | | |--leaf "41" | | | `--leaf "57" | | `--[dendrogram w/ 2 branches and 2 members at h = 10839] | | |--leaf "10" | | `--leaf "36" | `--[dendrogram w/ 2 branches and 5 members at h = 25743] | |--[dendrogram w/ 2 branches and 3 members at h = 3065] | | |--leaf "61" | | `--[dendrogram w/ 2 branches and 2 members at h = 1847] | | |--leaf "29" | | `--leaf "46" | `--[dendrogram w/ 2 branches and 2 members at h = 9359] | |--leaf "35" | `--leaf "39" `--[dendrogram w/ 2 branches and 13 members at h = 485467] |--[dendrogram w/ 2 branches and 9 members at h = 81360] | |--[dendrogram w/ 2 branches and 2 members at h = 9865] | | |--leaf "13" | | `--leaf "25" | `--[dendrogram w/ 2 branches and 7 members at h = 40012] | |--[dendrogram w/ 2 branches and 3 members at h = 10705] | | |--leaf "22" | | `--[dendrogram w/ 2 branches and 2 members at h = 601] | | |--leaf "33" | | `--leaf "37" | `--[dendrogram w/ 2 branches and 4 members at h = 16464] | |--leaf "7" | `--[dendrogram w/ 2 branches and 3 members at h = 6013] | |--leaf "28" | `--[dendrogram w/ 2 branches and 2 members at h = 2800] | |--leaf "49" | `--leaf "53" `--[dendrogram w/ 2 branches and 4 members at h = 171113] |--leaf "32" `--[dendrogram w/ 2 branches and 3 members at h = 65480] |--leaf "24" `--[dendrogram w/ 2 branches and 2 members at h = 8748] |--leaf "31" `--leaf "34" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/14aib1226430808.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/29xwz1226430808.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/38alh1226430808.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/4llix1226430808.tab") + } > > system("convert tmp/14aib1226430808.ps tmp/14aib1226430808.png") > system("convert tmp/29xwz1226430808.ps tmp/29xwz1226430808.png") convert: unable to open image `tmp/29xwz1226430808.ps': No such file or directory. convert: missing an image filename `tmp/29xwz1226430808.png'. > > > proc.time() user system elapsed 0.791 0.191 0.960