R version 2.7.0 (2008-04-22) 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(2173 + ,2752 + ,572 + ,582 + ,2363 + ,2373 + ,582 + ,552 + ,2126 + ,1415 + ,574 + ,436 + ,1905 + ,2466 + ,461 + ,602 + ,2121 + ,2318 + ,576 + ,640 + ,1983 + ,2346 + ,460 + ,551 + ,1734 + ,1644 + ,455 + ,421 + ,2074 + ,1421 + ,444 + ,382 + ,2049 + ,1423 + ,488 + ,382 + ,2406 + ,1930 + ,513 + ,427 + ,2558 + ,2694 + ,468 + ,542 + ,2251 + ,4938 + ,488 + ,708 + ,2059 + ,1727 + ,536 + ,465 + ,2397 + ,1899 + ,486 + ,474 + ,1747 + ,1364 + ,460 + ,371 + ,1707 + ,1992 + ,376 + ,463 + ,2319 + ,2051 + ,503 + ,515 + ,1631 + ,2082 + ,369 + ,509 + ,1627 + ,1746 + ,353 + ,380 + ,1791 + ,1271 + ,359 + ,313 + ,2034 + ,1363 + ,400 + ,313 + ,1997 + ,1664 + ,374 + ,359 + ,2169 + ,2179 + ,430 + ,427 + ,2028 + ,2305 + ,433 + ,415 + ,2253 + ,2098 + ,418 + ,402 + ,2218 + ,2231 + ,438 + ,388 + ,1855 + ,1407 + ,389 + ,353 + ,2187 + ,1966 + ,368 + ,464 + ,1852 + ,2293 + ,386 + ,429 + ,1570 + ,2045 + ,261 + ,398 + ,1851 + ,1532 + ,294 + ,291 + ,1954 + ,1333 + ,263 + ,272 + ,1828 + ,1583 + ,293 + ,241 + ,2251 + ,1712 + ,303 + ,288 + ,2277 + ,2641 + ,326 + ,365 + ,2085 + ,2267 + ,314 + ,312 + ,2282 + ,2126 + ,332 + ,325 + ,2266 + ,2231 + ,347 + ,346 + ,1878 + ,1517 + ,290 + ,282 + ,2267 + ,2010 + ,340 + ,362 + ,2069 + ,2628 + ,371 + ,369 + ,1746 + ,2115 + ,340 + ,340 + ,2299 + ,1829 + ,376 + ,308 + ,2360 + ,1636 + ,322 + ,294 + ,2214 + ,1787 + ,364 + ,306 + ,2825 + ,2122 + ,379 + ,328 + ,2355 + ,2620 + ,343 + ,351 + ,2333 + ,2555 + ,358 + ,366 + ,3016 + ,2337 + ,433 + ,350 + ,2155 + ,2524 + ,344 + ,356 + ,2172 + ,1801 + ,357 + ,295 + ,2150 + ,2417 + ,385 + ,359 + ,2533 + ,2389 + ,392 + ,380 + ,2058 + ,2267 + ,308 + ,360 + ,2160 + ,2135 + ,294 + ,336 + ,2259 + ,1760 + ,300 + ,299 + ,2498 + ,1905 + ,302 + ,262 + ,2695 + ,2176 + ,400 + ,299 + ,2799 + ,2344 + ,392 + ,313 + ,2945 + ,2673 + ,373 + ,357 + ,2930 + ,2766 + ,379 + ,356 + ,2318 + ,2785 + ,303 + ,368 + ,2540 + ,2003 + ,324 + ,284 + ,2570 + ,2588 + ,353 + ,338 + ,2669 + ,2739 + ,392 + ,352 + ,2450 + ,2703 + ,327 + ,342 + ,2842 + ,2464 + ,376 + ,315 + ,3439 + ,1974 + ,329 + ,277 + ,2677 + ,2164 + ,359 + ,317 + ,2979 + ,2385 + ,413 + ,291 + ,2257 + ,2936 + ,338 + ,326 + ,2842 + ,2700 + ,421 + ,353 + ,2546 + ,2855 + ,390 + ,371 + ,2455 + ,2764 + ,370 + ,356 + ,2293 + ,1808 + ,366 + ,274 + ,2379 + ,2588 + ,405 + ,352 + ,2478 + ,2600 + ,418 + ,347 + ,2054 + ,2526 + ,346 + ,345 + ,2272 + ,2259 + ,349 + ,336 + ,2351 + ,1738 + ,326 + ,276 + ,2271 + ,1902 + ,318 + ,312 + ,2542 + ,2137 + ,379 + ,330 + ,2304 + ,2460 + ,336 + ,325 + ,2194 + ,2495 + ,372 + ,328 + ,2722 + ,2525 + ,420 + ,332 + ,2395 + ,2465 + ,425 + ,341 + ,2146 + ,1828 + ,422 + ,316 + ,1894 + ,2273 + ,396 + ,377 + ,2548 + ,2377 + ,457 + ,380 + ,2087 + ,2344 + ,313 + ,373 + ,2063 + ,2071 + ,334 + ,346 + ,2481 + ,1611 + ,384 + ,272 + ,2476 + ,1671 + ,342 + ,283 + ,2212 + ,2256 + ,385 + ,302 + ,2834 + ,1983 + ,435 + ,301 + ,2148 + ,1921 + ,405 + ,303 + ,2598 + ,2027 + ,454 + ,320) + ,dim=c(4 + ,97) + ,dimnames=list(c('Bow' + ,'Bew' + ,'Bonw' + ,'Benw') + ,1:97)) > y <- array(NA,dim=c(4,97),dimnames=list(c('Bow','Bew','Bonw','Benw'),1:97)) > 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 97 members at h = 16076] |--[dendrogram w/ 2 branches and 36 members at h = 5219] | |--[dendrogram w/ 2 branches and 17 members at h = 2575] | | |--[dendrogram w/ 2 branches and 8 members at h = 505] | | | |--[dendrogram w/ 2 branches and 2 members at h = 111] | | | | |--leaf "57" | | | | `--leaf "63" | | | `--[dendrogram w/ 2 branches and 6 members at h = 391] | | | |--[dendrogram w/ 2 branches and 2 members at h = 153] | | | | |--leaf "46" | | | | `--leaf "95" | | | `--[dendrogram w/ 2 branches and 4 members at h = 239] | | | |--[dendrogram w/ 2 branches and 2 members at h = 49.7] | | | | |--leaf "58" | | | | `--leaf "69" | | | `--[dendrogram w/ 2 branches and 2 members at h = 145] | | | |--leaf "82" | | | `--leaf "97" | | `--[dendrogram w/ 2 branches and 9 members at h = 1213] | | |--leaf "68" | | `--[dendrogram w/ 2 branches and 8 members at h = 814] | | |--[dendrogram w/ 2 branches and 3 members at h = 125] | | | |--leaf "72" | | | `--[dendrogram w/ 2 branches and 2 members at h = 94.4] | | | |--leaf "60" | | | `--leaf "61" | | `--[dendrogram w/ 2 branches and 5 members at h = 401] | | |--[dendrogram w/ 2 branches and 2 members at h = 87] | | | |--leaf "49" | | | `--leaf "70" | | `--[dendrogram w/ 2 branches and 3 members at h = 185] | | |--leaf "85" | | `--[dendrogram w/ 2 branches and 2 members at h = 128] | | |--leaf "59" | | `--leaf "67" | `--[dendrogram w/ 2 branches and 19 members at h = 4164] | |--leaf "12" | `--[dendrogram w/ 2 branches and 18 members at h = 1012] | |--[dendrogram w/ 2 branches and 8 members at h = 628] | | |--[dendrogram w/ 2 branches and 2 members at h = 67.8] | | | |--leaf "53" | | | `--leaf "89" | | `--[dendrogram w/ 2 branches and 6 members at h = 257] | | |--[dendrogram w/ 2 branches and 2 members at h = 128] | | | |--leaf "83" | | | `--leaf "86" | | `--[dendrogram w/ 2 branches and 4 members at h = 129] | | |--leaf "35" | | `--[dendrogram w/ 2 branches and 3 members at h = 75.2] | | |--leaf "76" | | `--[dendrogram w/ 2 branches and 2 members at h = 71.8] | | |--leaf "47" | | `--leaf "48" | `--[dendrogram w/ 2 branches and 10 members at h = 762] | |--[dendrogram w/ 2 branches and 7 members at h = 344] | | |--[dendrogram w/ 2 branches and 4 members at h = 252] | | | |--[dendrogram w/ 2 branches and 2 members at h = 76.1] | | | | |--leaf "66" | | | | `--leaf "74" | | | `--[dendrogram w/ 2 branches and 2 members at h = 114] | | | |--leaf "64" | | | `--leaf "77" | | `--[dendrogram w/ 2 branches and 3 members at h = 267] | | |--leaf "11" | | `--[dendrogram w/ 2 branches and 2 members at h = 170] | | |--leaf "65" | | `--leaf "73" | `--[dendrogram w/ 2 branches and 3 members at h = 460] | |--leaf "1" | `--[dendrogram w/ 2 branches and 2 members at h = 172] | |--leaf "62" | `--leaf "71" `--[dendrogram w/ 2 branches and 61 members at h = 8058] |--[dendrogram w/ 2 branches and 13 members at h = 1049] | |--[dendrogram w/ 2 branches and 4 members at h = 210] | | |--leaf "3" | | `--[dendrogram w/ 2 branches and 3 members at h = 140] | | |--leaf "21" | | `--[dendrogram w/ 2 branches and 2 members at h = 50.6] | | |--leaf "8" | | `--leaf "9" | `--[dendrogram w/ 2 branches and 9 members at h = 714] | |--[dendrogram w/ 2 branches and 2 members at h = 184] | | |--leaf "7" | | `--leaf "19" | `--[dendrogram w/ 2 branches and 7 members at h = 539] | |--[dendrogram w/ 2 branches and 3 members at h = 101] | | |--leaf "33" | | `--[dendrogram w/ 2 branches and 2 members at h = 32.4] | | |--leaf "31" | | `--leaf "39" | `--[dendrogram w/ 2 branches and 4 members at h = 276] | |--leaf "32" | `--[dendrogram w/ 2 branches and 3 members at h = 163] | |--leaf "20" | `--[dendrogram w/ 2 branches and 2 members at h = 137] | |--leaf "15" | `--leaf "27" `--[dendrogram w/ 2 branches and 48 members at h = 5670] |--[dendrogram w/ 2 branches and 19 members at h = 2240] | |--[dendrogram w/ 2 branches and 4 members at h = 220] | | |--leaf "42" | | `--[dendrogram w/ 2 branches and 3 members at h = 203] | | |--leaf "30" | | `--[dendrogram w/ 2 branches and 2 members at h = 127] | | |--leaf "16" | | `--leaf "18" | `--[dendrogram w/ 2 branches and 15 members at h = 954] | |--[dendrogram w/ 2 branches and 5 members at h = 242] | | |--[dendrogram w/ 2 branches and 2 members at h = 109] | | | |--leaf "41" | | | `--leaf "78" | | `--[dendrogram w/ 2 branches and 3 members at h = 119] | | |--leaf "52" | | `--[dendrogram w/ 2 branches and 2 members at h = 62.7] | | |--leaf "50" | | `--leaf "84" | `--[dendrogram w/ 2 branches and 10 members at h = 789] | |--[dendrogram w/ 2 branches and 2 members at h = 263] | | |--leaf "2" | | `--leaf "5" | `--[dendrogram w/ 2 branches and 8 members at h = 564] | |--[dendrogram w/ 2 branches and 3 members at h = 103] | | |--leaf "90" | | `--[dendrogram w/ 2 branches and 2 members at h = 55.4] | | |--leaf "36" | | `--leaf "54" | `--[dendrogram w/ 2 branches and 5 members at h = 329] | |--[dendrogram w/ 2 branches and 2 members at h = 70.5] | | |--leaf "29" | | `--leaf "88" | `--[dendrogram w/ 2 branches and 3 members at h = 236] | |--leaf "4" | `--[dendrogram w/ 2 branches and 2 members at h = 151] | |--leaf "6" | `--leaf "24" `--[dendrogram w/ 2 branches and 29 members at h = 2747] |--[dendrogram w/ 2 branches and 15 members at h = 892] | |--[dendrogram w/ 2 branches and 3 members at h = 212] | | |--leaf "17" | | `--[dendrogram w/ 2 branches and 2 members at h = 63.1] | | |--leaf "10" | | `--leaf "14" | `--[dendrogram w/ 2 branches and 12 members at h = 616] | |--[dendrogram w/ 2 branches and 7 members at h = 258] | | |--[dendrogram w/ 2 branches and 3 members at h = 97.2] | | | |--leaf "94" | | | `--[dendrogram w/ 2 branches and 2 members at h = 30.4] | | | |--leaf "38" | | | `--leaf "79" | | `--[dendrogram w/ 2 branches and 4 members at h = 209] | | |--[dendrogram w/ 2 branches and 2 members at h = 81.8] | | | |--leaf "23" | | | `--leaf "26" | | `--[dendrogram w/ 2 branches and 2 members at h = 122] | | |--leaf "25" | | `--leaf "37" | `--[dendrogram w/ 2 branches and 5 members at h = 344] | |--[dendrogram w/ 2 branches and 2 members at h = 123] | | |--leaf "55" | | `--leaf "91" | `--[dendrogram w/ 2 branches and 3 members at h = 181] | |--leaf "28" | `--[dendrogram w/ 2 branches and 2 members at h = 121] | |--leaf "40" | `--leaf "81" `--[dendrogram w/ 2 branches and 14 members at h = 901] |--[dendrogram w/ 2 branches and 8 members at h = 456] | |--[dendrogram w/ 2 branches and 2 members at h = 74.2] | | |--leaf "92" | | `--leaf "93" | `--[dendrogram w/ 2 branches and 6 members at h = 227] | |--[dendrogram w/ 2 branches and 2 members at h = 41.6] | | |--leaf "43" | | `--leaf "75" | `--[dendrogram w/ 2 branches and 4 members at h = 175] | |--[dendrogram w/ 2 branches and 2 members at h = 50] | | |--leaf "34" | | `--leaf "56" | `--[dendrogram w/ 2 branches and 2 members at h = 104] | |--leaf "44" | `--leaf "80" `--[dendrogram w/ 2 branches and 6 members at h = 464] |--[dendrogram w/ 2 branches and 4 members at h = 161] | |--[dendrogram w/ 2 branches and 2 members at h = 46.2] | | |--leaf "45" | | `--leaf "51" | `--[dendrogram w/ 2 branches and 2 members at h = 95.5] | |--leaf "87" | `--leaf "96" `--[dendrogram w/ 2 branches and 2 members at h = 213] |--leaf "13" `--leaf "22" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/19g4s1226419931.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/2rl9a1226419931.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/3n3a71226419931.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/41zf11226419931.tab") + } > > system("convert tmp/19g4s1226419931.ps tmp/19g4s1226419931.png") > system("convert tmp/2rl9a1226419931.ps tmp/2rl9a1226419931.png") convert: unable to open image `tmp/2rl9a1226419931.ps': No such file or directory. convert: missing an image filename `tmp/2rl9a1226419931.png'. > > > proc.time() user system elapsed 1.808 0.317 1.905