R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(848 + ,33 + ,25 + ,31.72 + ,742 + ,56 + ,25 + ,22.33 + ,714 + ,28 + ,21 + ,16.5 + ,449 + ,16 + ,22 + ,14.74 + ,384 + ,20 + ,35 + ,14.28 + ,461 + ,12 + ,21 + ,13.94 + ,507 + ,18 + ,25 + ,13.78 + ,546 + ,22 + ,25 + ,12.48 + ,999 + ,4 + ,0 + ,11.72 + ,440 + ,13 + ,23 + ,11.1 + ,378 + ,14 + ,29 + ,10.98 + ,659 + ,21 + ,22 + ,10.44 + ,406 + ,15 + ,24 + ,10.23 + ,380 + ,12 + ,19 + ,10.14 + ,374 + ,14 + ,14 + ,10.06 + ,316 + ,18 + ,24 + ,10.01 + ,389 + ,19 + ,25 + ,8.97 + ,341 + ,15 + ,21 + ,8.92 + ,250 + ,11 + ,14 + ,8.76 + ,386 + ,15 + ,24 + ,8.66 + ,439 + ,14 + ,16 + ,8.61 + ,333 + ,12 + ,17 + ,8.57 + ,254 + ,25 + ,24 + ,8.37 + ,349 + ,14 + ,14 + ,8.36 + ,323 + ,15 + ,24 + ,8.35 + ,379 + ,22 + ,20 + ,8.3 + ,280 + ,11 + ,20 + ,8.02 + ,235 + ,11 + ,25 + ,7.93 + ,376 + ,11 + ,25 + ,7.92 + ,326 + ,16 + ,25 + ,7.91 + ,196 + ,20 + ,25 + ,7.87 + ,303 + ,7 + ,25 + ,7.85 + ,311 + ,13 + ,15 + ,7.73 + ,445 + ,13 + ,9 + ,7.7 + ,411 + ,17 + ,29 + ,7.53 + ,351 + ,22 + ,23 + ,7.51 + ,235 + ,11 + ,25 + ,7.5 + ,356 + ,12 + ,24 + ,7.48 + ,330 + ,12 + ,23 + ,7.47 + ,319 + ,27 + ,24 + ,7.47 + ,503 + ,20 + ,10 + ,7.43 + ,327 + ,12 + ,13 + ,7.41 + ,272 + ,13 + ,25 + ,7.36 + ,299 + ,12 + ,20 + ,7.29 + ,586 + ,15 + ,23 + ,7.28 + ,469 + ,18 + ,16 + ,7.18 + ,199 + ,15 + ,0 + ,7.13 + ,209 + ,9 + ,13 + ,7.08 + ,310 + ,15 + ,23 + ,7.03 + ,339 + ,16 + ,24 + ,7 + ,445 + ,26 + ,24 + ,6.98 + ,340 + ,10 + ,25 + ,6.86 + ,290 + ,22 + ,17 + ,6.84 + ,295 + ,20 + ,9 + ,6.83 + ,329 + ,13 + ,25 + ,6.73 + ,264 + ,19 + ,13 + ,6.71 + ,261 + ,19 + ,21 + ,6.67 + ,265 + ,7 + ,17 + ,6.66 + ,237 + ,13 + ,10 + ,6.64 + ,309 + ,18 + ,11 + ,6.62 + ,252 + ,13 + ,25 + ,6.59 + ,230 + ,13 + ,25 + ,6.53 + ,260 + ,18 + ,22 + ,6.48 + ,306 + ,19 + ,17 + ,6.47 + ,185 + ,11 + ,25 + ,6.37 + ,240 + ,18 + ,7 + ,6.34 + ,275 + ,13 + ,19 + ,6.28 + ,302 + ,21 + ,15 + ,6.22 + ,323 + ,13 + ,25 + ,6.11 + ,234 + ,11 + ,11 + ,6.08 + ,240 + ,11 + ,19 + ,6.03 + ,219 + ,7 + ,24 + ,6.02 + ,378 + ,22 + ,26 + ,5.99 + ,320 + ,20 + ,20 + ,5.94 + ,337 + ,11 + ,5 + ,5.89 + ,218 + ,4 + ,17 + ,5.75 + ,194 + ,8 + ,24 + ,5.73 + ,238 + ,18 + ,16 + ,5.67 + ,332 + ,9 + ,25 + ,5.45 + ,243 + ,11 + ,25 + ,5.36 + ,256 + ,11 + ,23 + ,5.32 + ,271 + ,18 + ,23 + ,5.2 + ,201 + ,0 + ,25 + ,5.16 + ,319 + ,17 + ,19 + ,5.01 + ,160 + ,5 + ,10 + ,4.98 + ,278 + ,12 + ,23 + ,4.9 + ,297 + ,15 + ,12 + ,4.89 + ,191 + ,12 + ,3 + ,4.87 + ,212 + ,12 + ,25 + ,4.84 + ,254 + ,10 + ,10 + ,4.79 + ,314 + ,14 + ,7 + ,4.72 + ,230 + ,18 + ,10 + ,4.7 + ,173 + ,14 + ,11 + ,4.66 + ,269 + ,12 + ,28 + ,4.65 + ,265 + ,16 + ,19 + ,4.64 + ,158 + ,10 + ,20 + ,4.63 + ,284 + ,12 + ,19 + ,4.41 + ,165 + ,7 + ,10 + ,4.36 + ,169 + ,12 + ,0 + ,4.35 + ,237 + ,11 + ,0 + ,4.29 + ,185 + ,13 + ,14 + ,4.22 + ,293 + ,9 + ,20 + ,4.19 + ,272 + ,14 + ,24 + ,4.17 + ,289 + ,15 + ,1 + ,4.15 + ,251 + ,11 + ,4 + ,4.13 + ,241 + ,13 + ,14 + ,3.88 + ,218 + ,18 + ,10 + ,3.86 + ,294 + ,16 + ,11 + ,3.8 + ,213 + ,10 + ,25 + ,3.66 + ,245 + ,9 + ,0 + ,3.66 + ,156 + ,11 + ,10 + ,3.38 + ,87 + ,8 + ,20 + ,3.28 + ,166 + ,1 + ,4 + ,3.22 + ,228 + ,14 + ,3 + ,3.2 + ,140 + ,10 + ,25 + ,3.19 + ,110 + ,9 + ,4 + ,3.18 + ,278 + ,15 + ,19 + ,2.84 + ,102 + ,3 + ,0 + ,2.78 + ,172 + ,11 + ,0 + ,2.49 + ,128 + ,8 + ,3 + ,2.37 + ,186 + ,5 + ,4 + ,2.31 + ,84 + ,5 + ,0 + ,2.13 + ,246 + ,0 + ,5 + ,1.86 + ,78 + ,6 + ,0 + ,1.78 + ,40 + ,0 + ,0 + ,0.59 + ,7 + ,0 + ,0 + ,0.01 + ,0 + ,3 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0) + ,dim=c(4 + ,131) + ,dimnames=list(c('PAGES' + ,'BLOGS' + ,'LPRM' + ,'HRS') + ,1:131)) > y <- array(NA,dim=c(4,131),dimnames=list(c('PAGES','BLOGS','LPRM','HRS'),1:131)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par4 = 'yes' > par3 = '2' > par2 = 'none' > par1 = '3' > #'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] "LPRM" > x[,par1] [1] 25 25 21 22 35 21 25 25 0 23 29 22 24 19 14 24 25 21 14 24 16 17 24 14 24 [26] 20 20 25 25 25 25 25 15 9 29 23 25 24 23 24 10 13 25 20 23 16 0 13 23 24 [51] 24 25 17 9 25 13 21 17 10 11 25 25 22 17 25 7 19 15 25 11 19 24 26 20 5 [76] 17 24 16 25 25 23 23 25 19 10 23 12 3 25 10 7 10 11 28 19 20 19 10 0 0 [101] 14 20 24 1 4 14 10 11 25 0 10 20 4 3 25 4 19 0 0 3 4 0 5 0 0 [126] 0 0 0 0 0 0 > 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]) 0 1 3 4 5 7 9 10 11 12 13 14 15 16 17 19 20 21 22 23 24 25 26 28 29 35 16 1 3 4 2 2 2 8 4 1 3 5 2 3 5 7 7 4 3 8 12 24 1 1 2 1 > colnames(x) [1] "PAGES" "BLOGS" "LPRM" "HRS" > colnames(x)[par1] [1] "LPRM" > x[,par1] [1] 25 25 21 22 35 21 25 25 0 23 29 22 24 19 14 24 25 21 14 24 16 17 24 14 24 [26] 20 20 25 25 25 25 25 15 9 29 23 25 24 23 24 10 13 25 20 23 16 0 13 23 24 [51] 24 25 17 9 25 13 21 17 10 11 25 25 22 17 25 7 19 15 25 11 19 24 26 20 5 [76] 17 24 16 25 25 23 23 25 19 10 23 12 3 25 10 7 10 11 28 19 20 19 10 0 0 [101] 14 20 24 1 4 14 10 11 25 0 10 20 4 3 25 4 19 0 0 3 4 0 5 0 0 [126] 0 0 0 0 0 0 > if (par2 == 'none') { + m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) + } > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/1u5211319055679.tab") + } + } > m Conditional inference tree with 3 terminal nodes Response: LPRM Inputs: PAGES, BLOGS, HRS Number of observations: 131 1) HRS <= 4.36; criterion = 1, statistic = 33.859 2) HRS <= 2.78; criterion = 0.986, statistic = 8.028 3)* weights = 14 2) HRS > 2.78 4)* weights = 20 1) HRS > 4.36 5)* weights = 97 > postscript(file="/var/wessaorg/rcomp/tmp/2btuh1319055679.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/wessaorg/rcomp/tmp/3kcyv1319055679.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 25 19.4639175 5.5360825 2 25 19.4639175 5.5360825 3 21 19.4639175 1.5360825 4 22 19.4639175 2.5360825 5 35 19.4639175 15.5360825 6 21 19.4639175 1.5360825 7 25 19.4639175 5.5360825 8 25 19.4639175 5.5360825 9 0 19.4639175 -19.4639175 10 23 19.4639175 3.5360825 11 29 19.4639175 9.5360825 12 22 19.4639175 2.5360825 13 24 19.4639175 4.5360825 14 19 19.4639175 -0.4639175 15 14 19.4639175 -5.4639175 16 24 19.4639175 4.5360825 17 25 19.4639175 5.5360825 18 21 19.4639175 1.5360825 19 14 19.4639175 -5.4639175 20 24 19.4639175 4.5360825 21 16 19.4639175 -3.4639175 22 17 19.4639175 -2.4639175 23 24 19.4639175 4.5360825 24 14 19.4639175 -5.4639175 25 24 19.4639175 4.5360825 26 20 19.4639175 0.5360825 27 20 19.4639175 0.5360825 28 25 19.4639175 5.5360825 29 25 19.4639175 5.5360825 30 25 19.4639175 5.5360825 31 25 19.4639175 5.5360825 32 25 19.4639175 5.5360825 33 15 19.4639175 -4.4639175 34 9 19.4639175 -10.4639175 35 29 19.4639175 9.5360825 36 23 19.4639175 3.5360825 37 25 19.4639175 5.5360825 38 24 19.4639175 4.5360825 39 23 19.4639175 3.5360825 40 24 19.4639175 4.5360825 41 10 19.4639175 -9.4639175 42 13 19.4639175 -6.4639175 43 25 19.4639175 5.5360825 44 20 19.4639175 0.5360825 45 23 19.4639175 3.5360825 46 16 19.4639175 -3.4639175 47 0 19.4639175 -19.4639175 48 13 19.4639175 -6.4639175 49 23 19.4639175 3.5360825 50 24 19.4639175 4.5360825 51 24 19.4639175 4.5360825 52 25 19.4639175 5.5360825 53 17 19.4639175 -2.4639175 54 9 19.4639175 -10.4639175 55 25 19.4639175 5.5360825 56 13 19.4639175 -6.4639175 57 21 19.4639175 1.5360825 58 17 19.4639175 -2.4639175 59 10 19.4639175 -9.4639175 60 11 19.4639175 -8.4639175 61 25 19.4639175 5.5360825 62 25 19.4639175 5.5360825 63 22 19.4639175 2.5360825 64 17 19.4639175 -2.4639175 65 25 19.4639175 5.5360825 66 7 19.4639175 -12.4639175 67 19 19.4639175 -0.4639175 68 15 19.4639175 -4.4639175 69 25 19.4639175 5.5360825 70 11 19.4639175 -8.4639175 71 19 19.4639175 -0.4639175 72 24 19.4639175 4.5360825 73 26 19.4639175 6.5360825 74 20 19.4639175 0.5360825 75 5 19.4639175 -14.4639175 76 17 19.4639175 -2.4639175 77 24 19.4639175 4.5360825 78 16 19.4639175 -3.4639175 79 25 19.4639175 5.5360825 80 25 19.4639175 5.5360825 81 23 19.4639175 3.5360825 82 23 19.4639175 3.5360825 83 25 19.4639175 5.5360825 84 19 19.4639175 -0.4639175 85 10 19.4639175 -9.4639175 86 23 19.4639175 3.5360825 87 12 19.4639175 -7.4639175 88 3 19.4639175 -16.4639175 89 25 19.4639175 5.5360825 90 10 19.4639175 -9.4639175 91 7 19.4639175 -12.4639175 92 10 19.4639175 -9.4639175 93 11 19.4639175 -8.4639175 94 28 19.4639175 8.5360825 95 19 19.4639175 -0.4639175 96 20 19.4639175 0.5360825 97 19 19.4639175 -0.4639175 98 10 10.9000000 -0.9000000 99 0 10.9000000 -10.9000000 100 0 10.9000000 -10.9000000 101 14 10.9000000 3.1000000 102 20 10.9000000 9.1000000 103 24 10.9000000 13.1000000 104 1 10.9000000 -9.9000000 105 4 10.9000000 -6.9000000 106 14 10.9000000 3.1000000 107 10 10.9000000 -0.9000000 108 11 10.9000000 0.1000000 109 25 10.9000000 14.1000000 110 0 10.9000000 -10.9000000 111 10 10.9000000 -0.9000000 112 20 10.9000000 9.1000000 113 4 10.9000000 -6.9000000 114 3 10.9000000 -7.9000000 115 25 10.9000000 14.1000000 116 4 10.9000000 -6.9000000 117 19 10.9000000 8.1000000 118 0 0.8571429 -0.8571429 119 0 0.8571429 -0.8571429 120 3 0.8571429 2.1428571 121 4 0.8571429 3.1428571 122 0 0.8571429 -0.8571429 123 5 0.8571429 4.1428571 124 0 0.8571429 -0.8571429 125 0 0.8571429 -0.8571429 126 0 0.8571429 -0.8571429 127 0 0.8571429 -0.8571429 128 0 0.8571429 -0.8571429 129 0 0.8571429 -0.8571429 130 0 0.8571429 -0.8571429 131 0 0.8571429 -0.8571429 > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } > postscript(file="/var/wessaorg/rcomp/tmp/4t1351319055679.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/wessaorg/rcomp/tmp/5l5ms1319055679.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/wessaorg/rcomp/tmp/674r81319055679.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/wessaorg/rcomp/tmp/726r11319055679.tab") + } > > try(system("convert tmp/2btuh1319055679.ps tmp/2btuh1319055679.png",intern=TRUE)) character(0) > try(system("convert tmp/3kcyv1319055679.ps tmp/3kcyv1319055679.png",intern=TRUE)) character(0) > try(system("convert tmp/4t1351319055679.ps tmp/4t1351319055679.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.003 0.200 3.204