R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(112285 + ,24188 + ,146283 + ,144 + ,145 + ,84786 + ,18273 + ,98364 + ,103 + ,101 + ,83123 + ,14130 + ,86146 + ,98 + ,98 + ,101193 + ,32287 + ,96933 + ,135 + ,132 + ,38361 + ,8654 + ,79234 + ,61 + ,60 + ,68504 + ,9245 + ,42551 + ,39 + ,38 + ,119182 + ,33251 + ,195663 + ,150 + ,144 + ,22807 + ,1271 + ,6853 + ,5 + ,5 + ,17140 + ,5279 + ,21529 + ,28 + ,28 + ,116174 + ,27101 + ,95757 + ,84 + ,84 + ,57635 + ,16373 + ,85584 + ,80 + ,79 + ,66198 + ,19716 + ,143983 + ,130 + ,127 + ,71701 + ,17753 + ,75851 + ,82 + ,78 + ,57793 + ,9028 + ,59238 + ,60 + ,60 + ,80444 + ,18653 + ,93163 + ,131 + ,131 + ,53855 + ,8828 + ,96037 + ,84 + ,84 + ,97668 + ,29498 + ,151511 + ,140 + ,133 + ,133824 + ,27563 + ,136368 + ,151 + ,150 + ,101481 + ,18293 + ,112642 + ,91 + ,91 + ,99645 + ,22530 + ,94728 + ,138 + ,132 + ,114789 + ,15977 + ,105499 + ,150 + ,136 + ,99052 + ,35082 + ,121527 + ,124 + ,124 + ,67654 + ,16116 + ,127766 + ,119 + ,118 + ,65553 + ,15849 + ,98958 + ,73 + ,70 + ,97500 + ,16026 + ,77900 + ,110 + ,107 + ,69112 + ,26569 + ,85646 + ,123 + ,119 + ,82753 + ,24785 + ,98579 + ,90 + ,89 + ,85323 + ,17569 + ,130767 + ,116 + ,112 + ,72654 + ,23825 + ,131741 + ,113 + ,108 + ,30727 + ,7869 + ,53907 + ,56 + ,52 + ,77873 + ,14975 + ,178812 + ,115 + ,112 + ,117478 + ,37791 + ,146761 + ,119 + ,116 + ,74007 + ,9605 + ,82036 + ,129 + ,123 + ,90183 + ,27295 + ,163253 + ,127 + ,125 + ,61542 + ,2746 + ,27032 + ,27 + ,27 + ,101494 + ,34461 + ,171975 + ,175 + ,162 + ,27570 + ,8098 + ,65990 + ,35 + ,32 + ,55813 + ,4787 + ,86572 + ,64 + ,64 + ,79215 + ,24919 + ,159676 + ,96 + ,92 + ,1423 + ,603 + ,1929 + ,0 + ,0 + ,55461 + ,16329 + ,85371 + ,84 + ,83 + ,31081 + ,12558 + ,58391 + ,41 + ,41 + ,22996 + ,7784 + ,31580 + ,47 + ,47 + ,83122 + ,28522 + ,136815 + ,126 + ,120 + ,70106 + ,22265 + ,120642 + ,105 + ,105 + ,60578 + ,14459 + ,69107 + ,80 + ,79 + ,39992 + ,14526 + ,50495 + ,70 + ,65 + ,79892 + ,22240 + ,108016 + ,73 + ,70 + ,49810 + ,11802 + ,46341 + ,57 + ,55 + ,71570 + ,7623 + ,78348 + ,40 + ,39 + ,100708 + ,11912 + ,79336 + ,68 + ,67 + ,33032 + ,7935 + ,56968 + ,21 + ,21 + ,82875 + ,18220 + ,93176 + ,127 + ,127 + ,139077 + ,19199 + ,161632 + ,154 + ,152 + ,71595 + ,19918 + ,87850 + ,116 + ,113 + ,72260 + ,21884 + ,127969 + ,102 + ,99 + ,5950 + ,2694 + ,15049 + ,7 + ,7 + ,115762 + ,15808 + ,155135 + ,148 + ,141 + ,32551 + ,3597 + ,25109 + ,21 + ,21 + ,31701 + ,5296 + ,45824 + ,35 + ,35 + ,80670 + ,25239 + ,102996 + ,112 + ,109 + ,143558 + ,29801 + ,160604 + ,137 + ,133 + ,117105 + ,18450 + ,158051 + ,135 + ,123 + ,23789 + ,7132 + ,44547 + ,26 + ,26 + ,120733 + ,34861 + ,162647 + ,230 + ,230 + ,105195 + ,35940 + ,174141 + ,181 + ,166 + ,73107 + ,16688 + ,60622 + ,71 + ,68 + ,132068 + ,24683 + ,179566 + ,147 + ,147 + ,149193 + ,46230 + ,184301 + ,190 + ,179 + ,46821 + ,10387 + ,75661 + ,64 + ,61 + ,87011 + ,21436 + ,96144 + ,105 + ,101 + ,95260 + ,30546 + ,129847 + ,107 + ,108 + ,55183 + ,19746 + ,117286 + ,94 + ,90 + ,106671 + ,15977 + ,71180 + ,116 + ,114 + ,73511 + ,22583 + ,109377 + ,106 + ,103 + ,92945 + ,17274 + ,85298 + ,143 + ,142 + ,78664 + ,16469 + ,73631 + ,81 + ,79 + ,70054 + ,14251 + ,86767 + ,89 + ,88 + ,22618 + ,3007 + ,23824 + ,26 + ,25 + ,74011 + ,16851 + ,93487 + ,84 + ,83 + ,83737 + ,21113 + ,82981 + ,113 + ,113 + ,69094 + ,17401 + ,73815 + ,120 + ,118 + ,93133 + ,23958 + ,94552 + ,110 + ,110 + ,95536 + ,23567 + ,132190 + ,134 + ,129 + ,225920 + ,13065 + ,128754 + ,54 + ,51 + ,62133 + ,15358 + ,66363 + ,96 + ,93 + ,61370 + ,14587 + ,67808 + ,78 + ,76 + ,43836 + ,12770 + ,61724 + ,51 + ,49 + ,106117 + ,24021 + ,131722 + ,121 + ,118 + ,38692 + ,9648 + ,68580 + ,38 + ,38 + ,84651 + ,20537 + ,106175 + ,145 + ,141 + ,56622 + ,7905 + ,55792 + ,59 + ,58 + ,15986 + ,4527 + ,25157 + ,27 + ,27 + ,95364 + ,30495 + ,76669 + ,91 + ,91 + ,26706 + ,7117 + ,57283 + ,48 + ,48 + ,89691 + ,17719 + ,105805 + ,68 + ,63 + ,67267 + ,27056 + ,129484 + ,58 + ,56 + ,126846 + ,33473 + ,72413 + ,150 + ,144 + ,41140 + ,9758 + ,87831 + ,74 + ,73 + ,102860 + ,21115 + ,96971 + ,181 + ,168 + ,51715 + ,7236 + ,71299 + ,65 + ,64 + ,55801 + ,13790 + ,77494 + ,97 + ,97 + ,111813 + ,32902 + ,120336 + ,121 + ,117 + ,120293 + ,25131 + ,93913 + ,99 + ,100 + ,138599 + ,30910 + ,136048 + ,152 + ,149 + ,161647 + ,35947 + ,181248 + ,188 + ,187 + ,115929 + ,29848 + ,146123 + ,138 + ,127 + ,24266 + ,6943 + ,32036 + ,40 + ,37 + ,162901 + ,42705 + ,186646 + ,254 + ,245 + ,109825 + ,31808 + ,102255 + ,87 + ,87 + ,129838 + ,26675 + ,168237 + ,178 + ,177 + ,37510 + ,8435 + ,64219 + ,51 + ,49 + ,43750 + ,7409 + ,19630 + ,49 + ,49 + ,40652 + ,14993 + ,76825 + ,73 + ,73 + ,87771 + ,36867 + ,115338 + ,176 + ,177 + ,85872 + ,33835 + ,109427 + ,94 + ,94 + ,89275 + ,24164 + ,118168 + ,120 + ,117 + ,44418 + ,12607 + ,84845 + ,66 + ,60 + ,192565 + ,22609 + ,153197 + ,56 + ,55 + ,35232 + ,5892 + ,29877 + ,39 + ,39 + ,40909 + ,17014 + ,63506 + ,66 + ,64 + ,13294 + ,5394 + ,22445 + ,27 + ,26 + ,32387 + ,9178 + ,47695 + ,65 + ,64 + ,140867 + ,6440 + ,68370 + ,58 + ,58 + ,120662 + ,21916 + ,146304 + ,98 + ,95 + ,21233 + ,4011 + ,38233 + ,25 + ,25 + ,44332 + ,5818 + ,42071 + ,26 + ,26 + ,61056 + ,18647 + ,50517 + ,77 + ,76 + ,101338 + ,20556 + ,103950 + ,130 + ,129 + ,1168 + ,238 + ,5841 + ,11 + ,11 + ,13497 + ,70 + ,2341 + ,2 + ,2 + ,65567 + ,22392 + ,84396 + ,101 + ,101 + ,25162 + ,3913 + ,24610 + ,31 + ,28 + ,32334 + ,12237 + ,35753 + ,36 + ,36 + ,40735 + ,8388 + ,55515 + ,120 + ,89 + ,91413 + ,22120 + ,209056 + ,195 + ,193 + ,855 + ,338 + ,6622 + ,4 + ,4 + ,97068 + ,11727 + ,115814 + ,89 + ,84 + ,44339 + ,3704 + ,11609 + ,24 + ,23 + ,14116 + ,3988 + ,13155 + ,39 + ,39 + ,10288 + ,3030 + ,18274 + ,14 + ,14 + ,65622 + ,13520 + ,72875 + ,78 + ,78 + ,16563 + ,1421 + ,10112 + ,15 + ,14 + ,76643 + ,20923 + ,142775 + ,106 + ,101 + ,110681 + ,20237 + ,68847 + ,83 + ,82 + ,29011 + ,3219 + ,17659 + ,24 + ,24 + ,92696 + ,3769 + ,20112 + ,37 + ,36 + ,94785 + ,12252 + ,61023 + ,77 + ,75 + ,8773 + ,1888 + ,13983 + ,16 + ,16 + ,83209 + ,14497 + ,65176 + ,56 + ,55 + ,93815 + ,28864 + ,132432 + ,132 + ,131 + ,86687 + ,21721 + ,112494 + ,144 + ,131 + ,34553 + ,4821 + ,45109 + ,40 + ,39 + ,105547 + ,33644 + ,170875 + ,153 + ,144 + ,103487 + ,15923 + ,180759 + ,143 + ,139 + ,213688 + ,42935 + ,214921 + ,220 + ,211 + ,71220 + ,18864 + ,100226 + ,79 + ,78 + ,23517 + ,4977 + ,32043 + ,50 + ,50 + ,56926 + ,7785 + ,54454 + ,39 + ,39 + ,91721 + ,17939 + ,78876 + ,95 + ,90 + ,115168 + ,23436 + ,170745 + ,169 + ,166 + ,111194 + ,325 + ,6940 + ,12 + ,12 + ,51009 + ,13539 + ,49025 + ,63 + ,57 + ,135777 + ,34538 + ,122037 + ,134 + ,133 + ,51513 + ,12198 + ,53782 + ,69 + ,69 + ,74163 + ,26924 + ,127748 + ,119 + ,119 + ,51633 + ,12716 + ,86839 + ,119 + ,119 + ,75345 + ,8172 + ,44830 + ,75 + ,65 + ,33416 + ,10855 + ,77395 + ,63 + ,61 + ,83305 + ,11932 + ,89324 + ,55 + ,49 + ,98952 + ,14300 + ,103300 + ,103 + ,101 + ,102372 + ,25515 + ,112283 + ,197 + ,196 + ,37238 + ,2805 + ,10901 + ,16 + ,15 + ,103772 + ,29402 + ,120691 + ,140 + ,136 + ,123969 + ,16440 + ,58106 + ,89 + ,89 + ,27142 + ,11221 + ,57140 + ,40 + ,40 + ,135400 + ,28732 + ,122422 + ,125 + ,123 + ,21399 + ,5250 + ,25899 + ,21 + ,21 + ,130115 + ,28608 + ,139296 + ,167 + ,163 + ,24874 + ,8092 + ,52678 + ,32 + ,29 + ,34988 + ,4473 + ,23853 + ,36 + ,35 + ,45549 + ,1572 + ,17306 + ,13 + ,13 + ,6023 + ,2065 + ,7953 + ,5 + ,5 + ,64466 + ,14817 + ,89455 + ,96 + ,96 + ,54990 + ,16714 + ,147866 + ,151 + ,151 + ,1644 + ,556 + ,4245 + ,6 + ,6 + ,6179 + ,2089 + ,21509 + ,13 + ,13 + ,3926 + ,2658 + ,7670 + ,3 + ,3 + ,32755 + ,10695 + ,66675 + ,57 + ,56 + ,34777 + ,1669 + ,14336 + ,23 + ,23 + ,73224 + ,16267 + ,53608 + ,61 + ,57 + ,27114 + ,7768 + ,30059 + ,21 + ,14 + ,20760 + ,7252 + ,29668 + ,43 + ,43 + ,37636 + ,6387 + ,22097 + ,20 + ,20 + ,65461 + ,18715 + ,96841 + ,82 + ,72 + ,30080 + ,7936 + ,41907 + ,90 + ,87 + ,24094 + ,8643 + ,27080 + ,25 + ,21 + ,69008 + ,7294 + ,35885 + ,60 + ,56 + ,54968 + ,4570 + ,41247 + ,61 + ,59 + ,46090 + ,7185 + ,28313 + ,85 + ,82 + ,27507 + ,10058 + ,36845 + ,43 + ,43 + ,10672 + ,2342 + ,16548 + ,25 + ,25 + ,34029 + ,8509 + ,36134 + ,41 + ,38 + ,46300 + ,13275 + ,55764 + ,26 + ,25 + ,24760 + ,6816 + ,28910 + ,38 + ,38 + ,18779 + ,1930 + ,13339 + ,12 + ,12 + ,21280 + ,8086 + ,25319 + ,29 + ,29 + ,40662 + ,10737 + ,66956 + ,49 + ,47 + ,28987 + ,8033 + ,47487 + ,46 + ,45 + ,22827 + ,7058 + ,52785 + ,41 + ,40 + ,18513 + ,6782 + ,44683 + ,31 + ,30 + ,30594 + ,5401 + ,35619 + ,41 + ,41 + ,24006 + ,6521 + ,21920 + ,26 + ,25 + ,27913 + ,10856 + ,45608 + ,23 + ,23 + ,42744 + ,2154 + ,7721 + ,14 + ,14 + ,12934 + ,6117 + ,20634 + ,16 + ,16 + ,22574 + ,5238 + ,29788 + ,25 + ,26 + ,41385 + ,4820 + ,31931 + ,21 + ,21 + ,18653 + ,5615 + ,37754 + ,32 + ,27 + ,18472 + ,4272 + ,32505 + ,9 + ,9 + ,30976 + ,8702 + ,40557 + ,35 + ,33 + ,63339 + ,15340 + ,94238 + ,42 + ,42 + ,25568 + ,8030 + ,44197 + ,68 + ,68 + ,33747 + ,9526 + ,43228 + ,32 + ,32 + ,4154 + ,1278 + ,4103 + ,6 + ,6 + ,19474 + ,4236 + ,44144 + ,68 + ,67 + ,35130 + ,3023 + ,32868 + ,33 + ,33 + ,39067 + ,7196 + ,27640 + ,84 + ,77 + ,13310 + ,3394 + ,14063 + ,46 + ,46 + ,65892 + ,6371 + ,28990 + ,30 + ,30 + ,4143 + ,1574 + ,4694 + ,0 + ,0 + ,28579 + ,9620 + ,42648 + ,36 + ,36 + ,51776 + ,6978 + ,64329 + ,47 + ,46 + ,21152 + ,4911 + ,21928 + ,20 + ,18 + ,38084 + ,8645 + ,25836 + ,50 + ,48 + ,27717 + ,8987 + ,22779 + ,30 + ,29 + ,32928 + ,5544 + ,40820 + ,30 + ,28 + ,11342 + ,3083 + ,27530 + ,34 + ,34 + ,19499 + ,6909 + ,32378 + ,33 + ,33 + ,16380 + ,3189 + ,10824 + ,34 + ,34 + ,36874 + ,6745 + ,39613 + ,37 + ,33 + ,48259 + ,16724 + ,60865 + ,83 + ,80 + ,16734 + ,4850 + ,19787 + ,32 + ,32 + ,28207 + ,7025 + ,20107 + ,30 + ,30 + ,30143 + ,6047 + ,36605 + ,43 + ,41 + ,41369 + ,7377 + ,40961 + ,41 + ,41 + ,45833 + ,9078 + ,48231 + ,51 + ,51 + ,29156 + ,4605 + ,39725 + ,19 + ,18 + ,35944 + ,3238 + ,21455 + ,37 + ,34 + ,36278 + ,8100 + ,23430 + ,33 + ,31 + ,45588 + ,9653 + ,62991 + ,41 + ,39 + ,45097 + ,8914 + ,49363 + ,54 + ,54 + ,3895 + ,786 + ,9604 + ,14 + ,14 + ,28394 + ,6700 + ,24552 + ,25 + ,24 + ,18632 + ,5788 + ,31493 + ,25 + ,24 + ,2325 + ,593 + ,3439 + ,8 + ,8 + ,25139 + ,4506 + ,19555 + ,26 + ,26 + ,27975 + ,6382 + ,21228 + ,20 + ,19 + ,14483 + ,5621 + ,23177 + ,11 + ,11 + ,13127 + ,3997 + ,22094 + ,14 + ,14 + ,5839 + ,520 + ,2342 + ,3 + ,1 + ,24069 + ,8891 + ,38798 + ,40 + ,39 + ,3738 + ,999 + ,3255 + ,5 + ,5 + ,18625 + ,7067 + ,24261 + ,38 + ,37 + ,36341 + ,4639 + ,18511 + ,32 + ,32 + ,24548 + ,5654 + ,40798 + ,41 + ,38 + ,21792 + ,6928 + ,28893 + ,46 + ,47 + ,26263 + ,1514 + ,21425 + ,47 + ,47 + ,23686 + ,9238 + ,50276 + ,37 + ,37 + ,49303 + ,8204 + ,37643 + ,51 + ,51 + ,25659 + ,5926 + ,30377 + ,49 + ,45 + ,28904 + ,5785 + ,27126 + ,21 + ,21 + ,2781 + ,4 + ,13 + ,1 + ,1 + ,29236 + ,5930 + ,42097 + ,44 + ,42 + ,19546 + ,3710 + ,24451 + ,26 + ,26 + ,22818 + ,705 + ,14335 + ,21 + ,21 + ,32689 + ,443 + ,5084 + ,4 + ,4 + ,5752 + ,2416 + ,9927 + ,10 + ,10 + ,22197 + ,7747 + ,43527 + ,43 + ,43 + ,20055 + ,5432 + ,27184 + ,34 + ,34 + ,25272 + ,4913 + ,21610 + ,32 + ,31 + ,82206 + ,2650 + ,20484 + ,20 + ,19 + ,32073 + ,2370 + ,20156 + ,34 + ,34 + ,5444 + ,775 + ,6012 + ,6 + ,6 + ,20154 + ,5576 + ,18475 + ,12 + ,11 + ,36944 + ,1352 + ,12645 + ,24 + ,24 + ,8019 + ,3080 + ,11017 + ,16 + ,16 + ,30884 + ,10205 + ,37623 + ,72 + ,72 + ,19540 + ,6095 + ,35873 + ,27 + ,21) + ,dim=c(5 + ,289) + ,dimnames=list(c('totsize' + ,'totrevisions' + ,'totseconds' + ,'tothyperlinks' + ,'totblogs') + ,1:289)) > y <- array(NA,dim=c(5,289),dimnames=list(c('totsize','totrevisions','totseconds','tothyperlinks','totblogs'),1:289)) > 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 = '' > par2 = 'none' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #Technical description: > 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 Loading required package: sandwich Loading required package: strucchange Loading required package: vcd Loading required package: MASS Loading required package: colorspace > library(Hmisc) 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] "totsize" > x[,par1] [1] 112285 84786 83123 101193 38361 68504 119182 22807 17140 116174 [11] 57635 66198 71701 57793 80444 53855 97668 133824 101481 99645 [21] 114789 99052 67654 65553 97500 69112 82753 85323 72654 30727 [31] 77873 117478 74007 90183 61542 101494 27570 55813 79215 1423 [41] 55461 31081 22996 83122 70106 60578 39992 79892 49810 71570 [51] 100708 33032 82875 139077 71595 72260 5950 115762 32551 31701 [61] 80670 143558 117105 23789 120733 105195 73107 132068 149193 46821 [71] 87011 95260 55183 106671 73511 92945 78664 70054 22618 74011 [81] 83737 69094 93133 95536 225920 62133 61370 43836 106117 38692 [91] 84651 56622 15986 95364 26706 89691 67267 126846 41140 102860 [101] 51715 55801 111813 120293 138599 161647 115929 24266 162901 109825 [111] 129838 37510 43750 40652 87771 85872 89275 44418 192565 35232 [121] 40909 13294 32387 140867 120662 21233 44332 61056 101338 1168 [131] 13497 65567 25162 32334 40735 91413 855 97068 44339 14116 [141] 10288 65622 16563 76643 110681 29011 92696 94785 8773 83209 [151] 93815 86687 34553 105547 103487 213688 71220 23517 56926 91721 [161] 115168 111194 51009 135777 51513 74163 51633 75345 33416 83305 [171] 98952 102372 37238 103772 123969 27142 135400 21399 130115 24874 [181] 34988 45549 6023 64466 54990 1644 6179 3926 32755 34777 [191] 73224 27114 20760 37636 65461 30080 24094 69008 54968 46090 [201] 27507 10672 34029 46300 24760 18779 21280 40662 28987 22827 [211] 18513 30594 24006 27913 42744 12934 22574 41385 18653 18472 [221] 30976 63339 25568 33747 4154 19474 35130 39067 13310 65892 [231] 4143 28579 51776 21152 38084 27717 32928 11342 19499 16380 [241] 36874 48259 16734 28207 30143 41369 45833 29156 35944 36278 [251] 45588 45097 3895 28394 18632 2325 25139 27975 14483 13127 [261] 5839 24069 3738 18625 36341 24548 21792 26263 23686 49303 [271] 25659 28904 2781 29236 19546 22818 32689 5752 22197 20055 [281] 25272 82206 32073 5444 20154 36944 8019 30884 19540 > 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]) 855 1168 1423 1644 2325 2781 3738 3895 3926 4143 4154 1 1 1 1 1 1 1 1 1 1 1 5444 5752 5839 5950 6023 6179 8019 8773 10288 10672 11342 1 1 1 1 1 1 1 1 1 1 1 12934 13127 13294 13310 13497 14116 14483 15986 16380 16563 16734 1 1 1 1 1 1 1 1 1 1 1 17140 18472 18513 18625 18632 18653 18779 19474 19499 19540 19546 1 1 1 1 1 1 1 1 1 1 1 20055 20154 20760 21152 21233 21280 21399 21792 22197 22574 22618 1 1 1 1 1 1 1 1 1 1 1 22807 22818 22827 22996 23517 23686 23789 24006 24069 24094 24266 1 1 1 1 1 1 1 1 1 1 1 24548 24760 24874 25139 25162 25272 25568 25659 26263 26706 27114 1 1 1 1 1 1 1 1 1 1 1 27142 27507 27570 27717 27913 27975 28207 28394 28579 28904 28987 1 1 1 1 1 1 1 1 1 1 1 29011 29156 29236 30080 30143 30594 30727 30884 30976 31081 31701 1 1 1 1 1 1 1 1 1 1 1 32073 32334 32387 32551 32689 32755 32928 33032 33416 33747 34029 1 1 1 1 1 1 1 1 1 1 1 34553 34777 34988 35130 35232 35944 36278 36341 36874 36944 37238 1 1 1 1 1 1 1 1 1 1 1 37510 37636 38084 38361 38692 39067 39992 40652 40662 40735 40909 1 1 1 1 1 1 1 1 1 1 1 41140 41369 41385 42744 43750 43836 44332 44339 44418 45097 45549 1 1 1 1 1 1 1 1 1 1 1 45588 45833 46090 46300 46821 48259 49303 49810 51009 51513 51633 1 1 1 1 1 1 1 1 1 1 1 51715 51776 53855 54968 54990 55183 55461 55801 55813 56622 56926 1 1 1 1 1 1 1 1 1 1 1 57635 57793 60578 61056 61370 61542 62133 63339 64466 65461 65553 1 1 1 1 1 1 1 1 1 1 1 65567 65622 65892 66198 67267 67654 68504 69008 69094 69112 70054 1 1 1 1 1 1 1 1 1 1 1 70106 71220 71570 71595 71701 72260 72654 73107 73224 73511 74007 1 1 1 1 1 1 1 1 1 1 1 74011 74163 75345 76643 77873 78664 79215 79892 80444 80670 82206 1 1 1 1 1 1 1 1 1 1 1 82753 82875 83122 83123 83209 83305 83737 84651 84786 85323 85872 1 1 1 1 1 1 1 1 1 1 1 86687 87011 87771 89275 89691 90183 91413 91721 92696 92945 93133 1 1 1 1 1 1 1 1 1 1 1 93815 94785 95260 95364 95536 97068 97500 97668 98952 99052 99645 1 1 1 1 1 1 1 1 1 1 1 100708 101193 101338 101481 101494 102372 102860 103487 103772 105195 105547 1 1 1 1 1 1 1 1 1 1 1 106117 106671 109825 110681 111194 111813 112285 114789 115168 115762 115929 1 1 1 1 1 1 1 1 1 1 1 116174 117105 117478 119182 120293 120662 120733 123969 126846 129838 130115 1 1 1 1 1 1 1 1 1 1 1 132068 133824 135400 135777 138599 139077 140867 143558 149193 161647 162901 1 1 1 1 1 1 1 1 1 1 1 192565 213688 225920 1 1 1 > colnames(x) [1] "totsize" "totrevisions" "totseconds" "tothyperlinks" [5] "totblogs" > colnames(x)[par1] [1] "totsize" > x[,par1] [1] 112285 84786 83123 101193 38361 68504 119182 22807 17140 116174 [11] 57635 66198 71701 57793 80444 53855 97668 133824 101481 99645 [21] 114789 99052 67654 65553 97500 69112 82753 85323 72654 30727 [31] 77873 117478 74007 90183 61542 101494 27570 55813 79215 1423 [41] 55461 31081 22996 83122 70106 60578 39992 79892 49810 71570 [51] 100708 33032 82875 139077 71595 72260 5950 115762 32551 31701 [61] 80670 143558 117105 23789 120733 105195 73107 132068 149193 46821 [71] 87011 95260 55183 106671 73511 92945 78664 70054 22618 74011 [81] 83737 69094 93133 95536 225920 62133 61370 43836 106117 38692 [91] 84651 56622 15986 95364 26706 89691 67267 126846 41140 102860 [101] 51715 55801 111813 120293 138599 161647 115929 24266 162901 109825 [111] 129838 37510 43750 40652 87771 85872 89275 44418 192565 35232 [121] 40909 13294 32387 140867 120662 21233 44332 61056 101338 1168 [131] 13497 65567 25162 32334 40735 91413 855 97068 44339 14116 [141] 10288 65622 16563 76643 110681 29011 92696 94785 8773 83209 [151] 93815 86687 34553 105547 103487 213688 71220 23517 56926 91721 [161] 115168 111194 51009 135777 51513 74163 51633 75345 33416 83305 [171] 98952 102372 37238 103772 123969 27142 135400 21399 130115 24874 [181] 34988 45549 6023 64466 54990 1644 6179 3926 32755 34777 [191] 73224 27114 20760 37636 65461 30080 24094 69008 54968 46090 [201] 27507 10672 34029 46300 24760 18779 21280 40662 28987 22827 [211] 18513 30594 24006 27913 42744 12934 22574 41385 18653 18472 [221] 30976 63339 25568 33747 4154 19474 35130 39067 13310 65892 [231] 4143 28579 51776 21152 38084 27717 32928 11342 19499 16380 [241] 36874 48259 16734 28207 30143 41369 45833 29156 35944 36278 [251] 45588 45097 3895 28394 18632 2325 25139 27975 14483 13127 [261] 5839 24069 3738 18625 36341 24548 21792 26263 23686 49303 [271] 25659 28904 2781 29236 19546 22818 32689 5752 22197 20055 [281] 25272 82206 32073 5444 20154 36944 8019 30884 19540 > if (par2 == 'none') { + m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) + } > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/1nd5v1323976558.tab") + } + } > m Conditional inference tree with 9 terminal nodes Response: totsize Inputs: totrevisions, totseconds, tothyperlinks, totblogs Number of observations: 289 1) totseconds <= 67808; criterion = 1, statistic = 195.162 2) totblogs <= 50; criterion = 1, statistic = 52.804 3) tothyperlinks <= 11; criterion = 1, statistic = 18.703 4)* weights = 20 3) tothyperlinks > 11 5)* weights = 115 2) totblogs > 50 6) totrevisions <= 12198; criterion = 0.963, statistic = 6.735 7)* weights = 20 6) totrevisions > 12198 8)* weights = 12 1) totseconds > 67808 9) totseconds <= 120642; criterion = 1, statistic = 36.68 10) totrevisions <= 15849; criterion = 1, statistic = 17.72 11)* weights = 26 10) totrevisions > 15849 12) totrevisions <= 26569; criterion = 0.963, statistic = 6.758 13) tothyperlinks <= 127; criterion = 0.96, statistic = 6.602 14)* weights = 30 13) tothyperlinks > 127 15)* weights = 9 12) totrevisions > 26569 16)* weights = 8 9) totseconds > 120642 17)* weights = 49 > postscript(file="/var/www/rcomp/tmp/2wws71323976558.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/www/rcomp/tmp/3kgvj1323976558.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 112285 113150.51 -865.5102 2 84786 81016.37 3769.6333 3 83123 65058.81 18064.1923 4 101193 104357.25 -3164.2500 5 38361 65058.81 -26697.8077 6 68504 29973.25 38530.7478 7 119182 113150.51 6031.4898 8 22807 7855.65 14951.3500 9 17140 29973.25 -12833.2522 10 116174 104357.25 11816.7500 11 57635 81016.37 -23381.3667 12 66198 113150.51 -46952.5102 13 71701 81016.37 -9315.3667 14 57793 44152.95 13640.0500 15 80444 96192.33 -15748.3333 16 53855 65058.81 -11203.8077 17 97668 113150.51 -15482.5102 18 133824 113150.51 20673.4898 19 101481 81016.37 20464.6333 20 99645 96192.33 3452.6667 21 114789 96192.33 18596.6667 22 99052 113150.51 -14098.5102 23 67654 113150.51 -45496.5102 24 65553 65058.81 494.1923 25 97500 81016.37 16483.6333 26 69112 81016.37 -11904.3667 27 82753 81016.37 1736.6333 28 85323 113150.51 -27827.5102 29 72654 113150.51 -40496.5102 30 30727 44152.95 -13425.9500 31 77873 113150.51 -35277.5102 32 117478 113150.51 4327.4898 33 74007 65058.81 8948.1923 34 90183 113150.51 -22967.5102 35 61542 29973.25 31568.7478 36 101494 113150.51 -11656.5102 37 27570 29973.25 -2403.2522 38 55813 65058.81 -9245.8077 39 79215 113150.51 -33935.5102 40 1423 7855.65 -6432.6500 41 55461 81016.37 -25555.3667 42 31081 29973.25 1107.7478 43 22996 29973.25 -6977.2522 44 83122 113150.51 -30028.5102 45 70106 81016.37 -10910.3667 46 60578 65058.81 -4480.8077 47 39992 67751.83 -27759.8333 48 79892 81016.37 -1124.3667 49 49810 44152.95 5657.0500 50 71570 65058.81 6511.1923 51 100708 65058.81 35649.1923 52 33032 29973.25 3058.7478 53 82875 81016.37 1858.6333 54 139077 113150.51 25926.4898 55 71595 81016.37 -9421.3667 56 72260 113150.51 -40890.5102 57 5950 7855.65 -1905.6500 58 115762 113150.51 2611.4898 59 32551 29973.25 2577.7478 60 31701 29973.25 1727.7478 61 80670 81016.37 -346.3667 62 143558 113150.51 30407.4898 63 117105 113150.51 3954.4898 64 23789 29973.25 -6184.2522 65 120733 113150.51 7582.4898 66 105195 113150.51 -7955.5102 67 73107 67751.83 5355.1667 68 132068 113150.51 18917.4898 69 149193 113150.51 36042.4898 70 46821 65058.81 -18237.8077 71 87011 81016.37 5994.6333 72 95260 113150.51 -17890.5102 73 55183 81016.37 -25833.3667 74 106671 81016.37 25654.6333 75 73511 81016.37 -7505.3667 76 92945 96192.33 -3247.3333 77 78664 81016.37 -2352.3667 78 70054 65058.81 4995.1923 79 22618 29973.25 -7355.2522 80 74011 81016.37 -7005.3667 81 83737 81016.37 2720.6333 82 69094 81016.37 -11922.3667 83 93133 81016.37 12116.6333 84 95536 113150.51 -17614.5102 85 225920 113150.51 112769.4898 86 62133 67751.83 -5618.8333 87 61370 67751.83 -6381.8333 88 43836 29973.25 13862.7478 89 106117 113150.51 -7033.5102 90 38692 65058.81 -26366.8077 91 84651 96192.33 -11541.3333 92 56622 44152.95 12469.0500 93 15986 29973.25 -13987.2522 94 95364 104357.25 -8993.2500 95 26706 29973.25 -3267.2522 96 89691 81016.37 8674.6333 97 67267 113150.51 -45883.5102 98 126846 104357.25 22488.7500 99 41140 65058.81 -23918.8077 100 102860 96192.33 6667.6667 101 51715 65058.81 -13343.8077 102 55801 65058.81 -9257.8077 103 111813 104357.25 7455.7500 104 120293 81016.37 39276.6333 105 138599 113150.51 25448.4898 106 161647 113150.51 48496.4898 107 115929 113150.51 2778.4898 108 24266 29973.25 -5707.2522 109 162901 113150.51 49750.4898 110 109825 104357.25 5467.7500 111 129838 113150.51 16687.4898 112 37510 29973.25 7536.7478 113 43750 29973.25 13776.7478 114 40652 65058.81 -24406.8077 115 87771 104357.25 -16586.2500 116 85872 104357.25 -18485.2500 117 89275 81016.37 8258.6333 118 44418 65058.81 -20640.8077 119 192565 113150.51 79414.4898 120 35232 29973.25 5258.7478 121 40909 67751.83 -26842.8333 122 13294 29973.25 -16679.2522 123 32387 44152.95 -11765.9500 124 140867 65058.81 75808.1923 125 120662 113150.51 7511.4898 126 21233 29973.25 -8740.2522 127 44332 29973.25 14358.7478 128 61056 67751.83 -6695.8333 129 101338 96192.33 5145.6667 130 1168 7855.65 -6687.6500 131 13497 7855.65 5641.3500 132 65567 81016.37 -15449.3667 133 25162 29973.25 -4811.2522 134 32334 29973.25 2360.7478 135 40735 44152.95 -3417.9500 136 91413 113150.51 -21737.5102 137 855 7855.65 -7000.6500 138 97068 65058.81 32009.1923 139 44339 29973.25 14365.7478 140 14116 29973.25 -15857.2522 141 10288 29973.25 -19685.2522 142 65622 65058.81 563.1923 143 16563 29973.25 -13410.2522 144 76643 113150.51 -36507.5102 145 110681 81016.37 29664.6333 146 29011 29973.25 -962.2522 147 92696 29973.25 62722.7478 148 94785 67751.83 27033.1667 149 8773 29973.25 -21200.2522 150 83209 67751.83 15457.1667 151 93815 113150.51 -19335.5102 152 86687 96192.33 -9505.3333 153 34553 29973.25 4579.7478 154 105547 113150.51 -7603.5102 155 103487 113150.51 -9663.5102 156 213688 113150.51 100537.4898 157 71220 81016.37 -9796.3667 158 23517 29973.25 -6456.2522 159 56926 29973.25 26952.7478 160 91721 81016.37 10704.6333 161 115168 113150.51 2017.4898 162 111194 29973.25 81220.7478 163 51009 67751.83 -16742.8333 164 135777 113150.51 22626.4898 165 51513 44152.95 7360.0500 166 74163 113150.51 -38987.5102 167 51633 65058.81 -13425.8077 168 75345 44152.95 31192.0500 169 33416 65058.81 -31642.8077 170 83305 65058.81 18246.1923 171 98952 65058.81 33893.1923 172 102372 96192.33 6179.6667 173 37238 29973.25 7264.7478 174 103772 113150.51 -9378.5102 175 123969 67751.83 56217.1667 176 27142 29973.25 -2831.2522 177 135400 113150.51 22249.4898 178 21399 29973.25 -8574.2522 179 130115 113150.51 16964.4898 180 24874 29973.25 -5099.2522 181 34988 29973.25 5014.7478 182 45549 29973.25 15575.7478 183 6023 7855.65 -1832.6500 184 64466 65058.81 -592.8077 185 54990 113150.51 -58160.5102 186 1644 7855.65 -6211.6500 187 6179 29973.25 -23794.2522 188 3926 7855.65 -3929.6500 189 32755 44152.95 -11397.9500 190 34777 29973.25 4803.7478 191 73224 67751.83 5472.1667 192 27114 29973.25 -2859.2522 193 20760 29973.25 -9213.2522 194 37636 29973.25 7662.7478 195 65461 81016.37 -15555.3667 196 30080 44152.95 -14072.9500 197 24094 29973.25 -5879.2522 198 69008 44152.95 24855.0500 199 54968 44152.95 10815.0500 200 46090 44152.95 1937.0500 201 27507 29973.25 -2466.2522 202 10672 29973.25 -19301.2522 203 34029 29973.25 4055.7478 204 46300 29973.25 16326.7478 205 24760 29973.25 -5213.2522 206 18779 29973.25 -11194.2522 207 21280 29973.25 -8693.2522 208 40662 29973.25 10688.7478 209 28987 29973.25 -986.2522 210 22827 29973.25 -7146.2522 211 18513 29973.25 -11460.2522 212 30594 29973.25 620.7478 213 24006 29973.25 -5967.2522 214 27913 29973.25 -2060.2522 215 42744 29973.25 12770.7478 216 12934 29973.25 -17039.2522 217 22574 29973.25 -7399.2522 218 41385 29973.25 11411.7478 219 18653 29973.25 -11320.2522 220 18472 7855.65 10616.3500 221 30976 29973.25 1002.7478 222 63339 65058.81 -1719.8077 223 25568 44152.95 -18584.9500 224 33747 29973.25 3773.7478 225 4154 7855.65 -3701.6500 226 19474 44152.95 -24678.9500 227 35130 29973.25 5156.7478 228 39067 44152.95 -5085.9500 229 13310 29973.25 -16663.2522 230 65892 29973.25 35918.7478 231 4143 7855.65 -3712.6500 232 28579 29973.25 -1394.2522 233 51776 29973.25 21802.7478 234 21152 29973.25 -8821.2522 235 38084 29973.25 8110.7478 236 27717 29973.25 -2256.2522 237 32928 29973.25 2954.7478 238 11342 29973.25 -18631.2522 239 19499 29973.25 -10474.2522 240 16380 29973.25 -13593.2522 241 36874 29973.25 6900.7478 242 48259 67751.83 -19492.8333 243 16734 29973.25 -13239.2522 244 28207 29973.25 -1766.2522 245 30143 29973.25 169.7478 246 41369 29973.25 11395.7478 247 45833 44152.95 1680.0500 248 29156 29973.25 -817.2522 249 35944 29973.25 5970.7478 250 36278 29973.25 6304.7478 251 45588 29973.25 15614.7478 252 45097 44152.95 944.0500 253 3895 29973.25 -26078.2522 254 28394 29973.25 -1579.2522 255 18632 29973.25 -11341.2522 256 2325 7855.65 -5530.6500 257 25139 29973.25 -4834.2522 258 27975 29973.25 -1998.2522 259 14483 7855.65 6627.3500 260 13127 29973.25 -16846.2522 261 5839 7855.65 -2016.6500 262 24069 29973.25 -5904.2522 263 3738 7855.65 -4117.6500 264 18625 29973.25 -11348.2522 265 36341 29973.25 6367.7478 266 24548 29973.25 -5425.2522 267 21792 29973.25 -8181.2522 268 26263 29973.25 -3710.2522 269 23686 29973.25 -6287.2522 270 49303 44152.95 5150.0500 271 25659 29973.25 -4314.2522 272 28904 29973.25 -1069.2522 273 2781 7855.65 -5074.6500 274 29236 29973.25 -737.2522 275 19546 29973.25 -10427.2522 276 22818 29973.25 -7155.2522 277 32689 7855.65 24833.3500 278 5752 7855.65 -2103.6500 279 22197 29973.25 -7776.2522 280 20055 29973.25 -9918.2522 281 25272 29973.25 -4701.2522 282 82206 29973.25 52232.7478 283 32073 29973.25 2099.7478 284 5444 7855.65 -2411.6500 285 20154 29973.25 -9819.2522 286 36944 29973.25 6970.7478 287 8019 29973.25 -21954.2522 288 30884 44152.95 -13268.9500 289 19540 29973.25 -10433.2522 > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } > postscript(file="/var/www/rcomp/tmp/4lcuy1323976558.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/www/rcomp/tmp/5yz2e1323976558.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/www/rcomp/tmp/63pdb1323976558.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/www/rcomp/tmp/7eiff1323976558.tab") + } > > try(system("convert tmp/2wws71323976558.ps tmp/2wws71323976558.png",intern=TRUE)) character(0) > try(system("convert tmp/3kgvj1323976558.ps tmp/3kgvj1323976558.png",intern=TRUE)) character(0) > try(system("convert tmp/4lcuy1323976558.ps tmp/4lcuy1323976558.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.200 0.200 4.362