R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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(210907 + ,1 + ,1 + ,24188 + ,145 + ,120982 + ,1 + ,1 + ,18273 + ,101 + ,176508 + ,1 + ,1 + ,14130 + ,98 + ,179321 + ,1 + ,0 + ,32287 + ,132 + ,123185 + ,1 + ,1 + ,8654 + ,60 + ,52746 + ,1 + ,1 + ,9245 + ,38 + ,385534 + ,1 + ,1 + ,33251 + ,144 + ,33170 + ,1 + ,1 + ,1271 + ,5 + ,101645 + ,1 + ,1 + ,5279 + ,28 + ,149061 + ,1 + ,1 + ,27101 + ,84 + ,165446 + ,1 + ,0 + ,16373 + ,79 + ,237213 + ,1 + ,1 + ,19716 + ,127 + ,173326 + ,1 + ,0 + ,17753 + ,78 + ,133131 + ,1 + ,1 + ,9028 + ,60 + ,258873 + ,1 + ,1 + ,18653 + ,131 + ,180083 + ,1 + ,0 + ,8828 + ,84 + ,324799 + ,1 + ,0 + ,29498 + ,133 + ,230964 + ,1 + ,1 + ,27563 + ,150 + ,236785 + ,1 + ,0 + ,18293 + ,91 + ,135473 + ,1 + ,1 + ,22530 + ,132 + ,202925 + ,1 + ,0 + ,15977 + ,136 + ,215147 + ,1 + ,1 + ,35082 + ,124 + ,344297 + ,1 + ,1 + ,16116 + ,118 + ,153935 + ,1 + ,1 + ,15849 + ,70 + ,132943 + ,1 + ,0 + ,16026 + ,107 + ,174724 + ,1 + ,1 + ,26569 + ,119 + ,174415 + ,1 + ,0 + ,24785 + ,89 + ,225548 + ,1 + ,1 + ,17569 + ,112 + ,223632 + ,1 + ,1 + ,23825 + ,108 + ,124817 + ,1 + ,0 + ,7869 + ,52 + ,221698 + ,1 + ,1 + ,14975 + ,112 + ,210767 + ,1 + ,0 + ,37791 + ,116 + ,170266 + ,1 + ,1 + ,9605 + ,123 + ,260561 + ,1 + ,1 + ,27295 + ,125 + ,84853 + ,1 + ,0 + ,2746 + ,27 + ,294424 + ,1 + ,0 + ,34461 + ,162 + ,101011 + ,1 + ,0 + ,8098 + ,32 + ,215641 + ,1 + ,0 + ,4787 + ,64 + ,325107 + ,1 + ,1 + ,24919 + ,92 + ,7176 + ,1 + ,0 + ,603 + ,0 + ,167542 + ,1 + ,0 + ,16329 + ,83 + ,106408 + ,1 + ,1 + ,12558 + ,41 + ,96560 + ,1 + ,0 + ,7784 + ,47 + ,265769 + ,1 + ,0 + ,28522 + ,120 + ,269651 + ,1 + ,1 + ,22265 + ,105 + ,149112 + ,1 + ,1 + ,14459 + ,79 + ,175824 + ,1 + ,1 + ,14526 + ,65 + ,152871 + ,1 + ,1 + ,22240 + ,70 + ,111665 + ,1 + ,1 + ,11802 + ,55 + ,116408 + ,1 + ,0 + ,7623 + ,39 + ,362301 + ,1 + ,1 + ,11912 + ,67 + ,78800 + ,1 + ,0 + ,7935 + ,21 + ,183167 + ,1 + ,0 + ,18220 + ,127 + ,277965 + ,1 + ,1 + ,19199 + ,152 + ,150629 + ,1 + ,0 + ,19918 + ,113 + ,168809 + ,1 + ,1 + ,21884 + ,99 + ,24188 + ,1 + ,1 + ,2694 + ,7 + ,329267 + ,1 + ,1 + ,15808 + ,141 + ,65029 + ,1 + ,0 + ,3597 + ,21 + ,101097 + ,1 + ,1 + ,5296 + ,35 + ,218946 + ,1 + ,0 + ,25239 + ,109 + ,244052 + ,1 + ,0 + ,29801 + ,133 + ,341570 + ,1 + ,1 + ,18450 + ,123 + ,103597 + ,1 + ,1 + ,7132 + ,26 + ,233328 + ,1 + ,1 + ,34861 + ,230 + ,256462 + ,1 + ,0 + ,35940 + ,166 + ,206161 + ,1 + ,1 + ,16688 + ,68 + ,311473 + ,1 + ,0 + ,24683 + ,147 + ,235800 + ,1 + ,1 + ,46230 + ,179 + ,177939 + ,1 + ,0 + ,10387 + ,61 + ,207176 + ,1 + ,0 + ,21436 + ,101 + ,196553 + ,1 + ,1 + ,30546 + ,108 + ,174184 + ,1 + ,1 + ,19746 + ,90 + ,143246 + ,1 + ,0 + ,15977 + ,114 + ,187559 + ,1 + ,0 + ,22583 + ,103 + ,187681 + ,1 + ,1 + ,17274 + ,142 + ,119016 + ,1 + ,1 + ,16469 + ,79 + ,182192 + ,1 + ,1 + ,14251 + ,88 + ,73566 + ,1 + ,0 + ,3007 + ,25 + ,194979 + ,1 + ,0 + ,16851 + ,83 + ,167488 + ,1 + ,0 + ,21113 + ,113 + ,143756 + ,1 + ,1 + ,17401 + ,118 + ,275541 + ,1 + ,0 + ,23958 + ,110 + ,243199 + ,1 + ,1 + ,23567 + ,129 + ,182999 + ,1 + ,1 + ,13065 + ,51 + ,135649 + ,1 + ,0 + ,15358 + ,93 + ,152299 + ,1 + ,1 + ,14587 + ,76 + ,120221 + ,1 + ,1 + ,12770 + ,49 + ,346485 + ,1 + ,1 + ,24021 + ,118 + ,145790 + ,1 + ,1 + ,9648 + ,38 + ,193339 + ,1 + ,1 + ,20537 + ,141 + ,80953 + ,1 + ,1 + ,7905 + ,58 + ,122774 + ,1 + ,1 + ,4527 + ,27 + ,130585 + ,1 + ,1 + ,30495 + ,91 + ,112611 + ,1 + ,1 + ,7117 + ,48 + ,286468 + ,1 + ,1 + ,17719 + ,63 + ,241066 + ,1 + ,1 + ,27056 + ,56 + ,148446 + ,1 + ,0 + ,33473 + ,144 + ,204713 + ,1 + ,0 + ,9758 + ,73 + ,182079 + ,1 + ,1 + ,21115 + ,168 + ,140344 + ,1 + ,0 + ,7236 + ,64 + ,220516 + ,1 + ,1 + ,13790 + ,97 + ,243060 + ,1 + ,0 + ,32902 + ,117 + ,162765 + ,1 + ,1 + ,25131 + ,100 + ,182613 + ,1 + ,0 + ,30910 + ,149 + ,232138 + ,1 + ,1 + ,35947 + ,187 + ,265318 + ,1 + ,0 + ,29848 + ,127 + ,85574 + ,1 + ,0 + ,6943 + ,37 + ,310839 + ,1 + ,1 + ,42705 + ,245 + ,225060 + ,1 + ,1 + ,31808 + ,87 + ,232317 + ,1 + ,1 + ,26675 + ,177 + ,144966 + ,1 + ,1 + ,8435 + ,49 + ,43287 + ,1 + ,1 + ,7409 + ,49 + ,155754 + ,1 + ,0 + ,14993 + ,73 + ,164709 + ,1 + ,1 + ,36867 + ,177 + ,201940 + ,1 + ,1 + ,33835 + ,94 + ,235454 + ,1 + ,1 + ,24164 + ,117 + ,220801 + ,1 + ,1 + ,12607 + ,60 + ,99466 + ,1 + ,0 + ,22609 + ,55 + ,92661 + ,1 + ,1 + ,5892 + ,39 + ,133328 + ,1 + ,1 + ,17014 + ,64 + ,61361 + ,1 + ,1 + ,5394 + ,26 + ,125930 + ,1 + ,1 + ,9178 + ,64 + ,100750 + ,1 + ,1 + ,6440 + ,58 + ,224549 + ,1 + ,0 + ,21916 + ,95 + ,82316 + ,1 + ,1 + ,4011 + ,25 + ,102010 + ,1 + ,1 + ,5818 + ,26 + ,101523 + ,1 + ,1 + ,18647 + ,76 + ,243511 + ,1 + ,0 + ,20556 + ,129 + ,22938 + ,1 + ,0 + ,238 + ,11 + ,41566 + ,1 + ,1 + ,70 + ,2 + ,152474 + ,1 + ,0 + ,22392 + ,101 + ,61857 + ,1 + ,0 + ,3913 + ,28 + ,99923 + ,1 + ,1 + ,12237 + ,36 + ,132487 + ,1 + ,0 + ,8388 + ,89 + ,317394 + ,1 + ,0 + ,22120 + ,193 + ,21054 + ,1 + ,1 + ,338 + ,4 + ,209641 + ,1 + ,1 + ,11727 + ,84 + ,22648 + ,1 + ,0 + ,3704 + ,23 + ,31414 + ,1 + ,1 + ,3988 + ,39 + ,46698 + ,1 + ,0 + ,3030 + ,14 + ,131698 + ,1 + ,1 + ,13520 + ,78 + ,91735 + ,1 + ,0 + ,1421 + ,14 + ,244749 + ,1 + ,1 + ,20923 + ,101 + ,184510 + ,1 + ,1 + ,20237 + ,82 + ,79863 + ,1 + ,0 + ,3219 + ,24 + ,128423 + ,1 + ,0 + ,3769 + ,36 + ,97839 + ,1 + ,0 + ,12252 + ,75 + ,38214 + ,1 + ,1 + ,1888 + ,16 + ,151101 + ,1 + ,1 + ,14497 + ,55 + ,272458 + ,1 + ,0 + ,28864 + ,131 + ,172494 + ,1 + ,1 + ,21721 + ,131 + ,108043 + ,1 + ,1 + ,4821 + ,39 + ,328107 + ,1 + ,1 + ,33644 + ,144 + ,250579 + ,1 + ,1 + ,15923 + ,139 + ,351067 + ,1 + ,1 + ,42935 + ,211 + ,158015 + ,1 + ,1 + ,18864 + ,78 + ,98866 + ,1 + ,1 + ,4977 + ,50 + ,85439 + ,0 + ,0 + ,7785 + ,39 + ,229242 + ,0 + ,0 + ,17939 + ,90 + ,351619 + ,0 + ,0 + ,23436 + ,166 + ,84207 + ,0 + ,1 + ,325 + ,12 + ,120445 + ,0 + ,0 + ,13539 + ,57 + ,324598 + ,0 + ,0 + ,34538 + ,133 + ,131069 + ,0 + ,1 + ,12198 + ,69 + ,204271 + ,0 + ,1 + ,26924 + ,119 + ,165543 + ,0 + ,0 + ,12716 + ,119 + ,141722 + ,0 + ,0 + ,8172 + ,65 + ,116048 + ,0 + ,1 + ,10855 + ,61 + ,250047 + ,0 + ,0 + ,11932 + ,49 + ,299775 + ,0 + ,1 + ,14300 + ,101 + ,195838 + ,0 + ,1 + ,25515 + ,196 + ,173260 + ,0 + ,0 + ,2805 + ,15 + ,254488 + ,0 + ,1 + ,29402 + ,136 + ,104389 + ,0 + ,0 + ,16440 + ,89 + ,136084 + ,0 + ,1 + ,11221 + ,40 + ,199476 + ,0 + ,1 + ,28732 + ,123 + ,92499 + ,0 + ,1 + ,5250 + ,21 + ,224330 + ,0 + ,0 + ,28608 + ,163 + ,135781 + ,0 + ,0 + ,8092 + ,29 + ,74408 + ,0 + ,0 + ,4473 + ,35 + ,81240 + ,0 + ,1 + ,1572 + ,13 + ,14688 + ,0 + ,1 + ,2065 + ,5 + ,181633 + ,0 + ,0 + ,14817 + ,96 + ,271856 + ,0 + ,1 + ,16714 + ,151 + ,7199 + ,0 + ,0 + ,556 + ,6 + ,46660 + ,0 + ,0 + ,2089 + ,13 + ,17547 + ,0 + ,1 + ,2658 + ,3 + ,133368 + ,0 + ,1 + ,10695 + ,56 + ,95227 + ,0 + ,1 + ,1669 + ,23 + ,152601 + ,0 + ,1 + ,16267 + ,57 + ,98146 + ,0 + ,1 + ,7768 + ,14 + ,79619 + ,0 + ,0 + ,7252 + ,43 + ,59194 + ,0 + ,1 + ,6387 + ,20 + ,139942 + ,0 + ,1 + ,18715 + ,72 + ,118612 + ,0 + ,0 + ,7936 + ,87 + ,72880 + ,0 + ,0 + ,8643 + ,21 + ,65475 + ,0 + ,0 + ,7294 + ,56 + ,99643 + ,0 + ,0 + ,4570 + ,59 + ,71965 + ,0 + ,0 + ,7185 + ,82 + ,77272 + ,0 + ,1 + ,10058 + ,43 + ,49289 + ,0 + ,1 + ,2342 + ,25 + ,135131 + ,0 + ,1 + ,8509 + ,38 + ,108446 + ,0 + ,0 + ,13275 + ,25 + ,89746 + ,0 + ,0 + ,6816 + ,38 + ,44296 + ,0 + ,0 + ,1930 + ,12 + ,77648 + ,0 + ,1 + ,8086 + ,29 + ,181528 + ,0 + ,0 + ,10737 + ,47 + ,134019 + ,0 + ,0 + ,8033 + ,45 + ,124064 + ,0 + ,0 + ,7058 + ,40 + ,92630 + ,0 + ,1 + ,6782 + ,30 + ,121848 + ,0 + ,0 + ,5401 + ,41 + ,52915 + ,0 + ,1 + ,6521 + ,25 + ,81872 + ,0 + ,1 + ,10856 + ,23 + ,58981 + ,0 + ,0 + ,2154 + ,14 + ,53515 + ,0 + ,1 + ,6117 + ,16 + ,60812 + ,0 + ,0 + ,5238 + ,26 + ,56375 + ,0 + ,0 + ,4820 + ,21 + ,65490 + ,0 + ,1 + ,5615 + ,27 + ,80949 + ,0 + ,0 + ,4272 + ,9 + ,76302 + ,0 + ,1 + ,8702 + ,33 + ,104011 + ,0 + ,0 + ,15340 + ,42 + ,98104 + ,0 + ,0 + ,8030 + ,68 + ,67989 + ,0 + ,0 + ,9526 + ,32 + ,30989 + ,0 + ,0 + ,1278 + ,6 + ,135458 + ,0 + ,1 + ,4236 + ,67 + ,73504 + ,0 + ,0 + ,3023 + ,33 + ,63123 + ,0 + ,0 + ,7196 + ,77 + ,61254 + ,0 + ,1 + ,3394 + ,46 + ,74914 + ,0 + ,1 + ,6371 + ,30 + ,31774 + ,0 + ,0 + ,1574 + ,0 + ,81437 + ,0 + ,0 + ,9620 + ,36 + ,87186 + ,0 + ,0 + ,6978 + ,46 + ,50090 + ,0 + ,1 + ,4911 + ,18 + ,65745 + ,0 + ,0 + ,8645 + ,48 + ,56653 + ,0 + ,0 + ,8987 + ,29 + ,158399 + ,0 + ,0 + ,5544 + ,28 + ,46455 + ,0 + ,0 + ,3083 + ,34 + ,73624 + ,0 + ,0 + ,6909 + ,33 + ,38395 + ,0 + ,0 + ,3189 + ,34 + ,91899 + ,0 + ,0 + ,6745 + ,33 + ,139526 + ,0 + ,1 + ,16724 + ,80 + ,52164 + ,0 + ,1 + ,4850 + ,32 + ,51567 + ,0 + ,1 + ,7025 + ,30 + ,70551 + ,0 + ,0 + ,6047 + ,41 + ,84856 + ,0 + ,0 + ,7377 + ,41 + ,102538 + ,0 + ,1 + ,9078 + ,51 + ,86678 + ,0 + ,1 + ,4605 + ,18 + ,85709 + ,0 + ,0 + ,3238 + ,34 + ,34662 + ,0 + ,0 + ,8100 + ,31 + ,150580 + ,0 + ,0 + ,9653 + ,39 + ,99611 + ,0 + ,1 + ,8914 + ,54 + ,19349 + ,0 + ,1 + ,786 + ,14 + ,99373 + ,0 + ,1 + ,6700 + ,24 + ,86230 + ,0 + ,1 + ,5788 + ,24 + ,30837 + ,0 + ,0 + ,593 + ,8 + ,31706 + ,0 + ,0 + ,4506 + ,26 + ,89806 + ,0 + ,0 + ,6382 + ,19 + ,62088 + ,0 + ,0 + ,5621 + ,11 + ,40151 + ,0 + ,1 + ,3997 + ,14 + ,27634 + ,0 + ,0 + ,520 + ,1 + ,76990 + ,0 + ,0 + ,8891 + ,39 + ,37460 + ,0 + ,1 + ,999 + ,5 + ,54157 + ,0 + ,0 + ,7067 + ,37 + ,49862 + ,0 + ,0 + ,4639 + ,32 + ,84337 + ,0 + ,1 + ,5654 + ,38 + ,64175 + ,0 + ,1 + ,6928 + ,47 + ,59382 + ,0 + ,0 + ,1514 + ,47 + ,119308 + ,0 + ,1 + ,9238 + ,37 + ,76702 + ,0 + ,0 + ,8204 + ,51 + ,103425 + ,0 + ,0 + ,5926 + ,45 + ,70344 + ,0 + ,1 + ,5785 + ,21 + ,43410 + ,0 + ,0 + ,4 + ,1 + ,104838 + ,0 + ,1 + ,5930 + ,42 + ,62215 + ,0 + ,0 + ,3710 + ,26 + ,69304 + ,0 + ,0 + ,705 + ,21 + ,53117 + ,0 + ,0 + ,443 + ,4 + ,19764 + ,0 + ,0 + ,2416 + ,10 + ,86680 + ,0 + ,1 + ,7747 + ,43 + ,84105 + ,0 + ,0 + ,5432 + ,34 + ,77945 + ,0 + ,0 + ,4913 + ,31 + ,89113 + ,0 + ,1 + ,2650 + ,19 + ,91005 + ,0 + ,0 + ,2370 + ,34 + ,40248 + ,0 + ,1 + ,775 + ,6 + ,64187 + ,0 + ,0 + ,5576 + ,11 + ,50857 + ,0 + ,0 + ,1352 + ,24 + ,56613 + ,0 + ,1 + ,3080 + ,16 + ,62792 + ,0 + ,1 + ,10205 + ,72) + ,dim=c(5 + ,288) + ,dimnames=list(c('time' + ,'pop' + ,'gender' + ,'reviews' + ,'blogs') + ,1:288)) > y <- array(NA,dim=c(5,288),dimnames=list(c('time','pop','gender','reviews','blogs'),1:288)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par4 = 'no' > par3 = '3' > par2 = 'none' > par1 = '1' > library(party) Loading required package: survival Loading required package: splines Loading required package: grid Loading required package: modeltools Loading required package: stats4 Loading required package: coin Loading required package: mvtnorm Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, as.Date.numeric Loading required package: sandwich Loading required package: strucchange Loading required package: vcd Loading required package: MASS Loading required package: colorspace > library(Hmisc) Hmisc library by Frank E Harrell Jr Type library(help='Hmisc'), ?Overview, or ?Hmisc.Overview') to see overall documentation. NOTE:Hmisc no longer redefines [.factor to drop unused levels when subsetting. To get the old behavior of Hmisc type dropUnusedLevels(). Attaching package: 'Hmisc' The following object(s) are masked from 'package:survival': untangle.specials The following object(s) are masked from 'package:base': format.pval, round.POSIXt, trunc.POSIXt, units > par1 <- as.numeric(par1) > par3 <- as.numeric(par3) > x <- data.frame(t(y)) > is.data.frame(x) [1] TRUE > x <- x[!is.na(x[,par1]),] > k <- length(x[1,]) > n <- length(x[,1]) > colnames(x)[par1] [1] "time" > x[,par1] [1] 210907 120982 176508 179321 123185 52746 385534 33170 101645 149061 [11] 165446 237213 173326 133131 258873 180083 324799 230964 236785 135473 [21] 202925 215147 344297 153935 132943 174724 174415 225548 223632 124817 [31] 221698 210767 170266 260561 84853 294424 101011 215641 325107 7176 [41] 167542 106408 96560 265769 269651 149112 175824 152871 111665 116408 [51] 362301 78800 183167 277965 150629 168809 24188 329267 65029 101097 [61] 218946 244052 341570 103597 233328 256462 206161 311473 235800 177939 [71] 207176 196553 174184 143246 187559 187681 119016 182192 73566 194979 [81] 167488 143756 275541 243199 182999 135649 152299 120221 346485 145790 [91] 193339 80953 122774 130585 112611 286468 241066 148446 204713 182079 [101] 140344 220516 243060 162765 182613 232138 265318 85574 310839 225060 [111] 232317 144966 43287 155754 164709 201940 235454 220801 99466 92661 [121] 133328 61361 125930 100750 224549 82316 102010 101523 243511 22938 [131] 41566 152474 61857 99923 132487 317394 21054 209641 22648 31414 [141] 46698 131698 91735 244749 184510 79863 128423 97839 38214 151101 [151] 272458 172494 108043 328107 250579 351067 158015 98866 85439 229242 [161] 351619 84207 120445 324598 131069 204271 165543 141722 116048 250047 [171] 299775 195838 173260 254488 104389 136084 199476 92499 224330 135781 [181] 74408 81240 14688 181633 271856 7199 46660 17547 133368 95227 [191] 152601 98146 79619 59194 139942 118612 72880 65475 99643 71965 [201] 77272 49289 135131 108446 89746 44296 77648 181528 134019 124064 [211] 92630 121848 52915 81872 58981 53515 60812 56375 65490 80949 [221] 76302 104011 98104 67989 30989 135458 73504 63123 61254 74914 [231] 31774 81437 87186 50090 65745 56653 158399 46455 73624 38395 [241] 91899 139526 52164 51567 70551 84856 102538 86678 85709 34662 [251] 150580 99611 19349 99373 86230 30837 31706 89806 62088 40151 [261] 27634 76990 37460 54157 49862 84337 64175 59382 119308 76702 [271] 103425 70344 43410 104838 62215 69304 53117 19764 86680 84105 [281] 77945 89113 91005 40248 64187 50857 56613 62792 > if (par2 == 'kmeans') { + cl <- kmeans(x[,par1], par3) + print(cl) + clm <- matrix(cbind(cl$centers,1:par3),ncol=2) + clm <- clm[sort.list(clm[,1]),] + for (i in 1:par3) { + cl$cluster[cl$cluster==clm[i,2]] <- paste('C',i,sep='') + } + cl$cluster <- as.factor(cl$cluster) + print(cl$cluster) + x[,par1] <- cl$cluster + } > if (par2 == 'quantiles') { + x[,par1] <- cut2(x[,par1],g=par3) + } > if (par2 == 'hclust') { + hc <- hclust(dist(x[,par1])^2, 'cen') + print(hc) + memb <- cutree(hc, k = par3) + dum <- c(mean(x[memb==1,par1])) + for (i in 2:par3) { + dum <- c(dum, mean(x[memb==i,par1])) + } + hcm <- matrix(cbind(dum,1:par3),ncol=2) + hcm <- hcm[sort.list(hcm[,1]),] + for (i in 1:par3) { + memb[memb==hcm[i,2]] <- paste('C',i,sep='') + } + memb <- as.factor(memb) + print(memb) + x[,par1] <- memb + } > if (par2=='equal') { + ed <- cut(as.numeric(x[,par1]),par3,labels=paste('C',1:par3,sep='')) + x[,par1] <- as.factor(ed) + } > table(x[,par1]) 7176 7199 14688 17547 19349 19764 21054 22648 22938 24188 27634 1 1 1 1 1 1 1 1 1 1 1 30837 30989 31414 31706 31774 33170 34662 37460 38214 38395 40151 1 1 1 1 1 1 1 1 1 1 1 40248 41566 43287 43410 44296 46455 46660 46698 49289 49862 50090 1 1 1 1 1 1 1 1 1 1 1 50857 51567 52164 52746 52915 53117 53515 54157 56375 56613 56653 1 1 1 1 1 1 1 1 1 1 1 58981 59194 59382 60812 61254 61361 61857 62088 62215 62792 63123 1 1 1 1 1 1 1 1 1 1 1 64175 64187 65029 65475 65490 65745 67989 69304 70344 70551 71965 1 1 1 1 1 1 1 1 1 1 1 72880 73504 73566 73624 74408 74914 76302 76702 76990 77272 77648 1 1 1 1 1 1 1 1 1 1 1 77945 78800 79619 79863 80949 80953 81240 81437 81872 82316 84105 1 1 1 1 1 1 1 1 1 1 1 84207 84337 84853 84856 85439 85574 85709 86230 86678 86680 87186 1 1 1 1 1 1 1 1 1 1 1 89113 89746 89806 91005 91735 91899 92499 92630 92661 95227 96560 1 1 1 1 1 1 1 1 1 1 1 97839 98104 98146 98866 99373 99466 99611 99643 99923 100750 101011 1 1 1 1 1 1 1 1 1 1 1 101097 101523 101645 102010 102538 103425 103597 104011 104389 104838 106408 1 1 1 1 1 1 1 1 1 1 1 108043 108446 111665 112611 116048 116408 118612 119016 119308 120221 120445 1 1 1 1 1 1 1 1 1 1 1 120982 121848 122774 123185 124064 124817 125930 128423 130585 131069 131698 1 1 1 1 1 1 1 1 1 1 1 132487 132943 133131 133328 133368 134019 135131 135458 135473 135649 135781 1 1 1 1 1 1 1 1 1 1 1 136084 139526 139942 140344 141722 143246 143756 144966 145790 148446 149061 1 1 1 1 1 1 1 1 1 1 1 149112 150580 150629 151101 152299 152474 152601 152871 153935 155754 158015 1 1 1 1 1 1 1 1 1 1 1 158399 162765 164709 165446 165543 167488 167542 168809 170266 172494 173260 1 1 1 1 1 1 1 1 1 1 1 173326 174184 174415 174724 175824 176508 177939 179321 180083 181528 181633 1 1 1 1 1 1 1 1 1 1 1 182079 182192 182613 182999 183167 184510 187559 187681 193339 194979 195838 1 1 1 1 1 1 1 1 1 1 1 196553 199476 201940 202925 204271 204713 206161 207176 209641 210767 210907 1 1 1 1 1 1 1 1 1 1 1 215147 215641 218946 220516 220801 221698 223632 224330 224549 225060 225548 1 1 1 1 1 1 1 1 1 1 1 229242 230964 232138 232317 233328 235454 235800 236785 237213 241066 243060 1 1 1 1 1 1 1 1 1 1 1 243199 243511 244052 244749 250047 250579 254488 256462 258873 260561 265318 1 1 1 1 1 1 1 1 1 1 1 265769 269651 271856 272458 275541 277965 286468 294424 299775 310839 311473 1 1 1 1 1 1 1 1 1 1 1 317394 324598 324799 325107 328107 329267 341570 344297 346485 351067 351619 1 1 1 1 1 1 1 1 1 1 1 362301 385534 1 1 > colnames(x) [1] "time" "pop" "gender" "reviews" "blogs" > colnames(x)[par1] [1] "time" > x[,par1] [1] 210907 120982 176508 179321 123185 52746 385534 33170 101645 149061 [11] 165446 237213 173326 133131 258873 180083 324799 230964 236785 135473 [21] 202925 215147 344297 153935 132943 174724 174415 225548 223632 124817 [31] 221698 210767 170266 260561 84853 294424 101011 215641 325107 7176 [41] 167542 106408 96560 265769 269651 149112 175824 152871 111665 116408 [51] 362301 78800 183167 277965 150629 168809 24188 329267 65029 101097 [61] 218946 244052 341570 103597 233328 256462 206161 311473 235800 177939 [71] 207176 196553 174184 143246 187559 187681 119016 182192 73566 194979 [81] 167488 143756 275541 243199 182999 135649 152299 120221 346485 145790 [91] 193339 80953 122774 130585 112611 286468 241066 148446 204713 182079 [101] 140344 220516 243060 162765 182613 232138 265318 85574 310839 225060 [111] 232317 144966 43287 155754 164709 201940 235454 220801 99466 92661 [121] 133328 61361 125930 100750 224549 82316 102010 101523 243511 22938 [131] 41566 152474 61857 99923 132487 317394 21054 209641 22648 31414 [141] 46698 131698 91735 244749 184510 79863 128423 97839 38214 151101 [151] 272458 172494 108043 328107 250579 351067 158015 98866 85439 229242 [161] 351619 84207 120445 324598 131069 204271 165543 141722 116048 250047 [171] 299775 195838 173260 254488 104389 136084 199476 92499 224330 135781 [181] 74408 81240 14688 181633 271856 7199 46660 17547 133368 95227 [191] 152601 98146 79619 59194 139942 118612 72880 65475 99643 71965 [201] 77272 49289 135131 108446 89746 44296 77648 181528 134019 124064 [211] 92630 121848 52915 81872 58981 53515 60812 56375 65490 80949 [221] 76302 104011 98104 67989 30989 135458 73504 63123 61254 74914 [231] 31774 81437 87186 50090 65745 56653 158399 46455 73624 38395 [241] 91899 139526 52164 51567 70551 84856 102538 86678 85709 34662 [251] 150580 99611 19349 99373 86230 30837 31706 89806 62088 40151 [261] 27634 76990 37460 54157 49862 84337 64175 59382 119308 76702 [271] 103425 70344 43410 104838 62215 69304 53117 19764 86680 84105 [281] 77945 89113 91005 40248 64187 50857 56613 62792 > if (par2 == 'none') { + m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) + } > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/rcomp/createtable") > > if (par2 != 'none') { + m <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data = x) + if (par4=='yes') { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'10-Fold Cross Validation',3+2*par3,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'',1,TRUE) + a<-table.element(a,'Prediction (training)',par3+1,TRUE) + a<-table.element(a,'Prediction (testing)',par3+1,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Actual',1,TRUE) + for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE) + a<-table.element(a,'CV',1,TRUE) + for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE) + a<-table.element(a,'CV',1,TRUE) + a<-table.row.end(a) + for (i in 1:10) { + ind <- sample(2, nrow(x), replace=T, prob=c(0.9,0.1)) + m.ct <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data =x[ind==1,]) + if (i==1) { + m.ct.i.pred <- predict(m.ct, newdata=x[ind==1,]) + m.ct.i.actu <- x[ind==1,par1] + m.ct.x.pred <- predict(m.ct, newdata=x[ind==2,]) + m.ct.x.actu <- x[ind==2,par1] + } else { + m.ct.i.pred <- c(m.ct.i.pred,predict(m.ct, newdata=x[ind==1,])) + m.ct.i.actu <- c(m.ct.i.actu,x[ind==1,par1]) + m.ct.x.pred <- c(m.ct.x.pred,predict(m.ct, newdata=x[ind==2,])) + m.ct.x.actu <- c(m.ct.x.actu,x[ind==2,par1]) + } + } + print(m.ct.i.tab <- table(m.ct.i.actu,m.ct.i.pred)) + numer <- 0 + for (i in 1:par3) { + print(m.ct.i.tab[i,i] / sum(m.ct.i.tab[i,])) + numer <- numer + m.ct.i.tab[i,i] + } + print(m.ct.i.cp <- numer / sum(m.ct.i.tab)) + print(m.ct.x.tab <- table(m.ct.x.actu,m.ct.x.pred)) + numer <- 0 + for (i in 1:par3) { + print(m.ct.x.tab[i,i] / sum(m.ct.x.tab[i,])) + numer <- numer + m.ct.x.tab[i,i] + } + print(m.ct.x.cp <- numer / sum(m.ct.x.tab)) + for (i in 1:par3) { + a<-table.row.start(a) + a<-table.element(a,paste('C',i,sep=''),1,TRUE) + for (jjj in 1:par3) a<-table.element(a,m.ct.i.tab[i,jjj]) + a<-table.element(a,round(m.ct.i.tab[i,i]/sum(m.ct.i.tab[i,]),4)) + for (jjj in 1:par3) a<-table.element(a,m.ct.x.tab[i,jjj]) + a<-table.element(a,round(m.ct.x.tab[i,i]/sum(m.ct.x.tab[i,]),4)) + a<-table.row.end(a) + } + a<-table.row.start(a) + a<-table.element(a,'Overall',1,TRUE) + for (jjj in 1:par3) a<-table.element(a,'-') + a<-table.element(a,round(m.ct.i.cp,4)) + for (jjj in 1:par3) a<-table.element(a,'-') + a<-table.element(a,round(m.ct.x.cp,4)) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/1nxmj1354890562.tab") + } + } > m Conditional inference tree with 7 terminal nodes Response: time Inputs: pop, gender, reviews, blogs Number of observations: 288 1) blogs <= 59; criterion = 1, statistic = 190.075 2) reviews <= 9620; criterion = 1, statistic = 64.767 3) blogs <= 11; criterion = 1, statistic = 37.858 4)* weights = 21 3) blogs > 11 5) reviews <= 4506; criterion = 0.991, statistic = 9.335 6)* weights = 36 5) reviews > 4506 7)* weights = 77 2) reviews > 9620 8)* weights = 20 1) blogs > 59 9) blogs <= 114; criterion = 1, statistic = 36.311 10) reviews <= 10855; criterion = 0.988, statistic = 8.754 11)* weights = 17 10) reviews > 10855 12)* weights = 60 9) blogs > 114 13)* weights = 57 > postscript(file="/var/fisher/rcomp/tmp/22bme1354890562.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(m) > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/3p90c1354890562.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,par1] ~ as.factor(where(m)),main='Response by Terminal Node',xlab='Terminal Node',ylab='Response') > dev.off() null device 1 > if (par2 == 'none') { + forec <- predict(m) + result <- as.data.frame(cbind(x[,par1],forec,x[,par1]-forec)) + colnames(result) <- c('Actuals','Forecasts','Residuals') + print(result) + } Actuals Forecasts Residuals 1 210907 244808.95 -33901.94737 2 120982 185081.75 -64099.75000 3 176508 185081.75 -8573.75000 4 179321 244808.95 -65487.94737 5 123185 131839.82 -8654.82353 6 52746 86734.39 -33988.38961 7 385534 244808.95 140725.05263 8 33170 33903.95 -733.95238 9 101645 86734.39 14910.61039 10 149061 185081.75 -36020.75000 11 165446 185081.75 -19635.75000 12 237213 244808.95 -7595.94737 13 173326 185081.75 -11755.75000 14 133131 131839.82 1291.17647 15 258873 244808.95 14064.05263 16 180083 131839.82 48243.17647 17 324799 244808.95 79990.05263 18 230964 244808.95 -13844.94737 19 236785 185081.75 51703.25000 20 135473 244808.95 -109335.94737 21 202925 244808.95 -41883.94737 22 215147 244808.95 -29661.94737 23 344297 244808.95 99488.05263 24 153935 185081.75 -31146.75000 25 132943 185081.75 -52138.75000 26 174724 244808.95 -70084.94737 27 174415 185081.75 -10666.75000 28 225548 185081.75 40466.25000 29 223632 185081.75 38550.25000 30 124817 86734.39 38082.61039 31 221698 185081.75 36616.25000 32 210767 244808.95 -34041.94737 33 170266 244808.95 -74542.94737 34 260561 244808.95 15752.05263 35 84853 66366.56 18486.44444 36 294424 244808.95 49615.05263 37 101011 86734.39 14276.61039 38 215641 131839.82 83801.17647 39 325107 185081.75 140025.25000 40 7176 33903.95 -26727.95238 41 167542 185081.75 -17539.75000 42 106408 137744.65 -31336.65000 43 96560 86734.39 9825.61039 44 265769 244808.95 20960.05263 45 269651 185081.75 84569.25000 46 149112 185081.75 -35969.75000 47 175824 185081.75 -9257.75000 48 152871 185081.75 -32210.75000 49 111665 137744.65 -26079.65000 50 116408 86734.39 29673.61039 51 362301 185081.75 177219.25000 52 78800 86734.39 -7934.38961 53 183167 244808.95 -61641.94737 54 277965 244808.95 33156.05263 55 150629 185081.75 -34452.75000 56 168809 185081.75 -16272.75000 57 24188 33903.95 -9715.95238 58 329267 244808.95 84458.05263 59 65029 66366.56 -1337.55556 60 101097 86734.39 14362.61039 61 218946 185081.75 33864.25000 62 244052 244808.95 -756.94737 63 341570 244808.95 96761.05263 64 103597 86734.39 16862.61039 65 233328 244808.95 -11480.94737 66 256462 244808.95 11653.05263 67 206161 185081.75 21079.25000 68 311473 244808.95 66664.05263 69 235800 244808.95 -9008.94737 70 177939 131839.82 46099.17647 71 207176 185081.75 22094.25000 72 196553 185081.75 11471.25000 73 174184 185081.75 -10897.75000 74 143246 185081.75 -41835.75000 75 187559 185081.75 2477.25000 76 187681 244808.95 -57127.94737 77 119016 185081.75 -66065.75000 78 182192 185081.75 -2889.75000 79 73566 66366.56 7199.44444 80 194979 185081.75 9897.25000 81 167488 185081.75 -17593.75000 82 143756 244808.95 -101052.94737 83 275541 185081.75 90459.25000 84 243199 244808.95 -1609.94737 85 182999 137744.65 45254.35000 86 135649 185081.75 -49432.75000 87 152299 185081.75 -32782.75000 88 120221 137744.65 -17523.65000 89 346485 244808.95 101676.05263 90 145790 137744.65 8045.35000 91 193339 244808.95 -51469.94737 92 80953 86734.39 -5781.38961 93 122774 86734.39 36039.61039 94 130585 185081.75 -54496.75000 95 112611 86734.39 25876.61039 96 286468 185081.75 101386.25000 97 241066 137744.65 103321.35000 98 148446 244808.95 -96362.94737 99 204713 131839.82 72873.17647 100 182079 244808.95 -62729.94737 101 140344 131839.82 8504.17647 102 220516 185081.75 35434.25000 103 243060 244808.95 -1748.94737 104 162765 185081.75 -22316.75000 105 182613 244808.95 -62195.94737 106 232138 244808.95 -12670.94737 107 265318 244808.95 20509.05263 108 85574 86734.39 -1160.38961 109 310839 244808.95 66030.05263 110 225060 185081.75 39978.25000 111 232317 244808.95 -12491.94737 112 144966 86734.39 58231.61039 113 43287 86734.39 -43447.38961 114 155754 185081.75 -29327.75000 115 164709 244808.95 -80099.94737 116 201940 185081.75 16858.25000 117 235454 244808.95 -9354.94737 118 220801 185081.75 35719.25000 119 99466 137744.65 -38278.65000 120 92661 86734.39 5926.61039 121 133328 185081.75 -51753.75000 122 61361 86734.39 -25373.38961 123 125930 131839.82 -5909.82353 124 100750 86734.39 14015.61039 125 224549 185081.75 39467.25000 126 82316 66366.56 15949.44444 127 102010 86734.39 15275.61039 128 101523 185081.75 -83558.75000 129 243511 244808.95 -1297.94737 130 22938 33903.95 -10965.95238 131 41566 33903.95 7662.04762 132 152474 185081.75 -32607.75000 133 61857 66366.56 -4509.55556 134 99923 137744.65 -37821.65000 135 132487 131839.82 647.17647 136 317394 244808.95 72585.05263 137 21054 33903.95 -12849.95238 138 209641 185081.75 24559.25000 139 22648 66366.56 -43718.55556 140 31414 66366.56 -34952.55556 141 46698 66366.56 -19668.55556 142 131698 185081.75 -53383.75000 143 91735 66366.56 25368.44444 144 244749 185081.75 59667.25000 145 184510 185081.75 -571.75000 146 79863 66366.56 13496.44444 147 128423 66366.56 62056.44444 148 97839 185081.75 -87242.75000 149 38214 66366.56 -28152.55556 150 151101 137744.65 13356.35000 151 272458 244808.95 27649.05263 152 172494 244808.95 -72314.94737 153 108043 86734.39 21308.61039 154 328107 244808.95 83298.05263 155 250579 244808.95 5770.05263 156 351067 244808.95 106258.05263 157 158015 185081.75 -27066.75000 158 98866 86734.39 12131.61039 159 85439 86734.39 -1295.38961 160 229242 185081.75 44160.25000 161 351619 244808.95 106810.05263 162 84207 66366.56 17840.44444 163 120445 137744.65 -17299.65000 164 324598 244808.95 79789.05263 165 131069 185081.75 -54012.75000 166 204271 244808.95 -40537.94737 167 165543 244808.95 -79265.94737 168 141722 131839.82 9882.17647 169 116048 131839.82 -15791.82353 170 250047 137744.65 112302.35000 171 299775 185081.75 114693.25000 172 195838 244808.95 -48970.94737 173 173260 66366.56 106893.44444 174 254488 244808.95 9679.05263 175 104389 185081.75 -80692.75000 176 136084 137744.65 -1660.65000 177 199476 244808.95 -45332.94737 178 92499 86734.39 5764.61039 179 224330 244808.95 -20478.94737 180 135781 86734.39 49046.61039 181 74408 66366.56 8041.44444 182 81240 66366.56 14873.44444 183 14688 33903.95 -19215.95238 184 181633 185081.75 -3448.75000 185 271856 244808.95 27047.05263 186 7199 33903.95 -26704.95238 187 46660 66366.56 -19706.55556 188 17547 33903.95 -16356.95238 189 133368 137744.65 -4376.65000 190 95227 66366.56 28860.44444 191 152601 137744.65 14856.35000 192 98146 86734.39 11411.61039 193 79619 86734.39 -7115.38961 194 59194 86734.39 -27540.38961 195 139942 185081.75 -45139.75000 196 118612 131839.82 -13227.82353 197 72880 86734.39 -13854.38961 198 65475 86734.39 -21259.38961 199 99643 86734.39 12908.61039 200 71965 131839.82 -59874.82353 201 77272 137744.65 -60472.65000 202 49289 66366.56 -17077.55556 203 135131 86734.39 48396.61039 204 108446 137744.65 -29298.65000 205 89746 86734.39 3011.61039 206 44296 66366.56 -22070.55556 207 77648 86734.39 -9086.38961 208 181528 137744.65 43783.35000 209 134019 86734.39 47284.61039 210 124064 86734.39 37329.61039 211 92630 86734.39 5895.61039 212 121848 86734.39 35113.61039 213 52915 86734.39 -33819.38961 214 81872 137744.65 -55872.65000 215 58981 66366.56 -7385.55556 216 53515 86734.39 -33219.38961 217 60812 86734.39 -25922.38961 218 56375 86734.39 -30359.38961 219 65490 86734.39 -21244.38961 220 80949 33903.95 47045.04762 221 76302 86734.39 -10432.38961 222 104011 137744.65 -33733.65000 223 98104 131839.82 -33735.82353 224 67989 86734.39 -18745.38961 225 30989 33903.95 -2914.95238 226 135458 131839.82 3618.17647 227 73504 66366.56 7137.44444 228 63123 131839.82 -68716.82353 229 61254 66366.56 -5112.55556 230 74914 86734.39 -11820.38961 231 31774 33903.95 -2129.95238 232 81437 86734.39 -5297.38961 233 87186 86734.39 451.61039 234 50090 86734.39 -36644.38961 235 65745 86734.39 -20989.38961 236 56653 86734.39 -30081.38961 237 158399 86734.39 71664.61039 238 46455 66366.56 -19911.55556 239 73624 86734.39 -13110.38961 240 38395 66366.56 -27971.55556 241 91899 86734.39 5164.61039 242 139526 185081.75 -45555.75000 243 52164 86734.39 -34570.38961 244 51567 86734.39 -35167.38961 245 70551 86734.39 -16183.38961 246 84856 86734.39 -1878.38961 247 102538 86734.39 15803.61039 248 86678 86734.39 -56.38961 249 85709 66366.56 19342.44444 250 34662 86734.39 -52072.38961 251 150580 137744.65 12835.35000 252 99611 86734.39 12876.61039 253 19349 66366.56 -47017.55556 254 99373 86734.39 12638.61039 255 86230 86734.39 -504.38961 256 30837 33903.95 -3066.95238 257 31706 66366.56 -34660.55556 258 89806 86734.39 3071.61039 259 62088 33903.95 28184.04762 260 40151 66366.56 -26215.55556 261 27634 33903.95 -6269.95238 262 76990 86734.39 -9744.38961 263 37460 33903.95 3556.04762 264 54157 86734.39 -32577.38961 265 49862 86734.39 -36872.38961 266 84337 86734.39 -2397.38961 267 64175 86734.39 -22559.38961 268 59382 66366.56 -6984.55556 269 119308 86734.39 32573.61039 270 76702 86734.39 -10032.38961 271 103425 86734.39 16690.61039 272 70344 86734.39 -16390.38961 273 43410 33903.95 9506.04762 274 104838 86734.39 18103.61039 275 62215 66366.56 -4151.55556 276 69304 66366.56 2937.44444 277 53117 33903.95 19213.04762 278 19764 33903.95 -14139.95238 279 86680 86734.39 -54.38961 280 84105 86734.39 -2629.38961 281 77945 86734.39 -8789.38961 282 89113 66366.56 22746.44444 283 91005 66366.56 24638.44444 284 40248 33903.95 6344.04762 285 64187 33903.95 30283.04762 286 50857 66366.56 -15509.55556 287 56613 66366.56 -9753.55556 288 62792 131839.82 -69047.82353 > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } > postscript(file="/var/fisher/rcomp/tmp/4yclr1354890562.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > if(par2=='none') { + op <- par(mfrow=c(2,2)) + plot(density(result$Actuals),main='Kernel Density Plot of Actuals') + plot(density(result$Residuals),main='Kernel Density Plot of Residuals') + plot(result$Forecasts,result$Actuals,main='Actuals versus Predictions',xlab='Predictions',ylab='Actuals') + plot(density(result$Forecasts),main='Kernel Density Plot of Predictions') + par(op) + } > if(par2!='none') { + plot(myt,main='Confusion Matrix',xlab='Actual',ylab='Predicted') + } > dev.off() null device 1 > if (par2 == 'none') { + detcoef <- cor(result$Forecasts,result$Actuals) + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goodness of Fit',2,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Correlation',1,TRUE) + a<-table.element(a,round(detcoef,4)) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'R-squared',1,TRUE) + a<-table.element(a,round(detcoef*detcoef,4)) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'RMSE',1,TRUE) + a<-table.element(a,round(sqrt(mean((result$Residuals)^2)),4)) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/5l8kp1354890562.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Actuals, Predictions, and Residuals',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'#',header=TRUE) + a<-table.element(a,'Actuals',header=TRUE) + a<-table.element(a,'Forecasts',header=TRUE) + a<-table.element(a,'Residuals',header=TRUE) + a<-table.row.end(a) + for (i in 1:length(result$Actuals)) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,result$Actuals[i]) + a<-table.element(a,result$Forecasts[i]) + a<-table.element(a,result$Residuals[i]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/6ilj51354890562.tab") + } > if (par2 != 'none') { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Confusion Matrix (predicted in columns / actuals in rows)',par3+1,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'',1,TRUE) + for (i in 1:par3) { + a<-table.element(a,paste('C',i,sep=''),1,TRUE) + } + a<-table.row.end(a) + for (i in 1:par3) { + a<-table.row.start(a) + a<-table.element(a,paste('C',i,sep=''),1,TRUE) + for (j in 1:par3) { + a<-table.element(a,myt[i,j]) + } + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/7d10n1354890562.tab") + } > > try(system("convert tmp/22bme1354890562.ps tmp/22bme1354890562.png",intern=TRUE)) character(0) > try(system("convert tmp/3p90c1354890562.ps tmp/3p90c1354890562.png",intern=TRUE)) character(0) > try(system("convert tmp/4yclr1354890562.ps tmp/4yclr1354890562.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.854 0.595 7.438