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(1846.5 + ,1530.9 + ,2225.4 + ,1163.9 + ,2796.3 + ,2220.6 + ,2713.9 + ,1467.9 + ,2895.6 + ,2161.5 + ,2923.3 + ,1433.7 + ,2472.2 + ,1863.6 + ,2707 + ,1362.2 + ,2584.4 + ,1955.1 + ,2473.9 + ,1299 + ,2630.4 + ,1907.4 + ,2521 + ,1291.5 + ,2663.1 + ,1889.4 + ,2531.8 + ,1452.7 + ,3176.2 + ,2246.3 + ,3068.8 + ,1555.4 + ,2856.7 + ,2213 + ,2826.9 + ,1402.5 + ,2551.4 + ,1965 + ,2674.2 + ,1242.9 + ,3088.7 + ,2285.6 + ,2966.6 + ,1514.6 + ,2628.3 + ,1983.8 + ,2798.8 + ,1308.6 + ,2226.2 + ,1872.4 + ,2629.6 + ,1239.3 + ,3023.6 + ,2371.4 + ,3124.6 + ,1519.9 + ,3077.9 + ,2287 + ,3115.7 + ,1659.4 + ,3084.1 + ,2198.2 + ,3083 + ,1597.6 + ,2990.3 + ,2330.4 + ,2863.9 + ,1340.6 + ,2949.6 + ,2014.4 + ,2728.7 + ,1427.2 + ,3014.7 + ,2066.1 + ,2789.4 + ,1438.1 + ,3517.7 + ,2355.8 + ,3225.7 + ,1616.2 + ,3121.2 + ,2232.5 + ,3148.2 + ,1392.8 + ,3067.4 + ,2091.7 + ,2836.5 + ,1318.7 + ,3174.6 + ,2376.5 + ,3153.5 + ,1420.9 + ,2676.3 + ,1931.9 + ,2656.9 + ,1221 + ,2424 + ,2025.7 + ,2834.7 + ,1310 + ,3195.1 + ,2404.9 + ,3172.5 + ,1466.7 + ,3146.6 + ,2316.1 + ,2998.8 + ,1299.3 + ,3506.7 + ,2368.1 + ,3103.1 + ,1640 + ,3528.5 + ,2282.5 + ,2735.6 + ,1506.3 + ,3365.1 + ,2158.6 + ,2818.1 + ,1530.2 + ,3153 + ,2174.8 + ,2874.4 + ,1661.9 + ,3843.3 + ,2594.1 + ,3438.5 + ,1880.3 + ,3123.2 + ,2281.4 + ,2949.1 + ,1230.8 + ,3361.1 + ,2547.9 + ,3306.8 + ,1406.5 + ,3481.9 + ,2606.3 + ,3530 + ,1523.5 + ,2970.5 + ,2190.8 + ,3003.8 + ,1323.2 + ,2537 + ,2262.3 + ,3206.4 + ,1319.2 + ,3257.6 + ,2423.8 + ,3514.6 + ,1500.7 + ,3301.3 + ,2520.4 + ,3522.6 + ,1483 + ,3391.6 + ,2482.9 + ,3525.5 + ,1497 + ,2933.6 + ,2215.9 + ,2996.2 + ,1219.8 + ,3283.2 + ,2441.9 + ,3231.1 + ,1472.9 + ,3139.7 + ,2333.8 + ,3030 + ,1423.9 + ,3486.4 + ,2670.2 + ,3541.7 + ,1629.6 + ,3202.2 + ,2431 + ,3113.2 + ,1353.4 + ,3294.4 + ,2559.3 + ,3390.8 + ,1366.8 + ,3550.3 + ,2661.4 + ,3424.2 + ,1527.1 + ,3279.3 + ,2404.6 + ,3079.8 + ,1487.6 + ,2678.6 + ,2378.3 + ,3123.4 + ,1478.6 + ,3451.4 + ,2489.2 + ,3317.1 + ,1536.7 + ,3977.1 + ,2959 + ,3611.6 + ,1682.1 + ,3814.8 + ,2713.5 + ,3341.1 + ,1576.5 + ,3310.5 + ,2341.3 + ,2684.9 + ,1280.5 + ,3971.8 + ,2833.2 + ,3747.8 + ,1756.5 + ,4051.9 + ,2849.7 + ,3677.8 + ,1698.8 + ,4057.6 + ,2871.7 + ,3787.8 + ,1709.3 + ,4391.4 + ,3058.3 + ,4171.2 + ,1741 + ,3628.9 + ,2855.1 + ,3774 + ,1493 + ,4092.2 + ,3083.6 + ,4053.7 + ,1577.5 + ,3822.5 + ,2828.3 + ,4000.9 + ,1609.3) + ,dim=c(4 + ,60) + ,dimnames=list(c('Frankrijk' + ,'Nederland' + ,'Duitsland' + ,'UK') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('Frankrijk','Nederland','Duitsland','UK'),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 = 17000] |--[dendrogram w/ 2 branches and 19 members at h = 4416] | |--[dendrogram w/ 2 branches and 9 members at h = 621] | | |--[dendrogram w/ 2 branches and 3 members at h = 163] | | | |--leaf "47" | | | `--[dendrogram w/ 2 branches and 2 members at h = 124] | | | |--leaf "35" | | | `--leaf "44" | | `--[dendrogram w/ 2 branches and 6 members at h = 426] | | |--[dendrogram w/ 2 branches and 3 members at h = 137] | | | |--leaf "38" | | | `--[dendrogram w/ 2 branches and 2 members at h = 98.8] | | | |--leaf "39" | | | `--leaf "40" | | `--[dendrogram w/ 2 branches and 3 members at h = 243] | | |--leaf "50" | | `--[dendrogram w/ 2 branches and 2 members at h = 115] | | |--leaf "34" | | `--leaf "46" | `--[dendrogram w/ 2 branches and 10 members at h = 1287] | |--[dendrogram w/ 2 branches and 2 members at h = 362] | | |--leaf "57" | | `--leaf "59" | `--[dendrogram w/ 2 branches and 8 members at h = 916] | |--[dendrogram w/ 2 branches and 2 members at h = 342] | | |--leaf "32" | | `--leaf "52" | `--[dendrogram w/ 2 branches and 6 members at h = 751] | |--[dendrogram w/ 2 branches and 4 members at h = 224] | | |--leaf "51" | | `--[dendrogram w/ 2 branches and 3 members at h = 119] | | |--leaf "55" | | `--[dendrogram w/ 2 branches and 2 members at h = 113] | | |--leaf "54" | | `--leaf "56" | `--[dendrogram w/ 2 branches and 2 members at h = 321] | |--leaf "58" | `--leaf "60" `--[dendrogram w/ 2 branches and 41 members at h = 7697] |--[dendrogram w/ 2 branches and 10 members at h = 1451] | |--leaf "1" | `--[dendrogram w/ 2 branches and 9 members at h = 613] | |--[dendrogram w/ 2 branches and 3 members at h = 212] | | |--leaf "7" | | `--[dendrogram w/ 2 branches and 2 members at h = 81.6] | | |--leaf "5" | | `--leaf "6" | `--[dendrogram w/ 2 branches and 6 members at h = 481] | |--leaf "13" | `--[dendrogram w/ 2 branches and 5 members at h = 316] | |--[dendrogram w/ 2 branches and 3 members at h = 184] | | |--leaf "12" | | `--[dendrogram w/ 2 branches and 2 members at h = 132] | | |--leaf "10" | | `--leaf "24" | `--[dendrogram w/ 2 branches and 2 members at h = 218] | |--leaf "4" | `--leaf "25" `--[dendrogram w/ 2 branches and 31 members at h = 2644] |--[dendrogram w/ 2 branches and 13 members at h = 1168] | |--[dendrogram w/ 2 branches and 2 members at h = 257] | | |--leaf "37" | | `--leaf "49" | `--[dendrogram w/ 2 branches and 11 members at h = 835] | |--[dendrogram w/ 2 branches and 5 members at h = 318] | | |--[dendrogram w/ 2 branches and 2 members at h = 113] | | | |--leaf "36" | | | `--leaf "41" | | `--[dendrogram w/ 2 branches and 3 members at h = 242] | | |--leaf "17" | | `--[dendrogram w/ 2 branches and 2 members at h = 94.4] | | |--leaf "27" | | `--leaf "33" | `--[dendrogram w/ 2 branches and 6 members at h = 449] | |--[dendrogram w/ 2 branches and 3 members at h = 198] | | |--leaf "22" | | `--[dendrogram w/ 2 branches and 2 members at h = 104] | | |--leaf "18" | | `--leaf "19" | `--[dendrogram w/ 2 branches and 3 members at h = 217] | |--leaf "2" | `--[dendrogram w/ 2 branches and 2 members at h = 120] | |--leaf "3" | `--leaf "9" `--[dendrogram w/ 2 branches and 18 members at h = 1306] |--[dendrogram w/ 2 branches and 3 members at h = 369] | |--leaf "53" | `--[dendrogram w/ 2 branches and 2 members at h = 222] | |--leaf "29" | `--leaf "30" `--[dendrogram w/ 2 branches and 15 members at h = 1012] |--[dendrogram w/ 2 branches and 8 members at h = 383] | |--[dendrogram w/ 2 branches and 4 members at h = 216] | | |--leaf "21" | | `--[dendrogram w/ 2 branches and 3 members at h = 205] | | |--leaf "14" | | `--[dendrogram w/ 2 branches and 2 members at h = 131] | | |--leaf "11" | | `--leaf "43" | `--[dendrogram w/ 2 branches and 4 members at h = 307] | |--leaf "31" | `--[dendrogram w/ 2 branches and 3 members at h = 142] | |--leaf "15" | `--[dendrogram w/ 2 branches and 2 members at h = 113] | |--leaf "8" | `--leaf "16" `--[dendrogram w/ 2 branches and 7 members at h = 780] |--[dendrogram w/ 2 branches and 2 members at h = 126] | |--leaf "20" | `--leaf "28" `--[dendrogram w/ 2 branches and 5 members at h = 185] |--[dendrogram w/ 2 branches and 3 members at h = 133] | |--leaf "45" | `--[dendrogram w/ 2 branches and 2 members at h = 60.7] | |--leaf "23" | `--leaf "26" `--[dendrogram w/ 2 branches and 2 members at h = 157] |--leaf "42" `--leaf "48" > mysub <- paste('Method: ',par1) > postscript(file="/var/www/html/rcomp/tmp/1tnfk1226570997.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/21lqt1226570997.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/3o8x11226570997.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/4phd41226570998.tab") + } > > system("convert tmp/1tnfk1226570997.ps tmp/1tnfk1226570997.png") > system("convert tmp/21lqt1226570997.ps tmp/21lqt1226570997.png") convert: unable to open image `tmp/21lqt1226570997.ps': No such file or directory. convert: missing an image filename `tmp/21lqt1226570997.png'. > > > proc.time() user system elapsed 0.803 0.197 1.320