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('yes',46,'yes',30,'yes',73,'yes',64,'yes',39,'yes',51,'yes',35,'yes',28,'yes',42,'yes',60,'yes',61,'yes',67,'yes',84,'yes',47,'yes',57,'yes',45,'yes',71,'yes',61,'yes',53,'yes',87,'no',51,'no',84,'no',77,'no',58,'no',37,'no',62,'no',59,'no',72,'no',40,'no',68,'no',72,'no',44,'no',101,'no',77,'no',61,'no',36,'no',80,'no',60,'no',74,'no',81),dim=c(2,40),dimnames=list(c('food_NoFood','Scores'),1:40)) > y <- array(NA,dim=c(2,40),dimnames=list(c('food_NoFood','Scores'),1:40)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } There were 40 warnings (use warnings() to see them) > par5 = '2' > par4 = '1' > par3 = '15' > par2 = 'TRUE' > par1 = 'grey' > ylab = 'Scores' > xlab = 'No food and food present' > main = 'Scores for PFS scales between groups' > par5 <- '2' > par4 <- '1' > par3 <- '20' > par2 <- 'TRUE' > par1 <- 'grey' > postscript(file="/var/fisher/rcomp/tmp/1q1fp1359981898.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > par2<- as.logical(par2) # notches > par3<-as.numeric(par3) # percentage trim > if(par3>45){par3<-45;warning('trim limited to 45%')} > if(par3<0){par3<-0;warning('negative trim makes no sense. Trim is zero.')} > par4 <- as.numeric(par4) #factor column > par5 <- as.numeric(par5) # response column > x <- t(x) > x1<-as.numeric(x[,par5]) # response > f1<-as.character(x[,par4]) # factor > x2<-x1[f1=='no'] > f2 <- f1[f1=='no'] > lotrm<-as.integer(length(x2)*par3/100) > hitrm<-as.integer(length(x2)*(100-par3)/100) > srt<-order(x2,f2) > trmx1<-x2[srt[lotrm:hitrm]] > trmf1<-f2[srt[lotrm:hitrm]] > x3<-x1[f1=='yes'] > f3 <- f1[f1=='yes'] > lotrm<-as.integer(length(x3)*par3/100) > hitrm<-as.integer(length(x3)*(100-par3)/100) > srt<-order(x3,f3) > trmx2<-x3[srt[lotrm:hitrm]] > trmf2<-f3[srt[lotrm:hitrm]] > xtrm<-c(trmx1,trmx2) > ftrm<-c(trmf1,trmf2) > xtrm[1:6] [1] 44 51 58 59 60 61 > ftrm[1:6] [1] "no" "no" "no" "no" "no" "no" > r<-boxplot(xtrm~as.factor(ftrm), col=par1, notch=par2, main=main, xlab=xlab, ylab=ylab) Warning message: In bxp(list(stats = c(44, 59, 62, 72, 77, 39, 46, 53, 61, 67), n = c(13, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/overview.htm','Boxplot statistics','Boxplot overview'),6,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Placement',1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/lower_whisker.htm','lower whisker','definition of lower whisker'),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/lower_hinge.htm','lower hinge','definition of lower hinge'),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/central_tendency.htm','median','definitions about measures of central tendency'),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/upper_hinge.htm','upper hinge','definition of upper hinge'),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/upper_whisker.htm','upper whisker','definition of upper whisker'),1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'no',1,TRUE) > for (j in 1:5) + { + a<-table.element(a,r$stats[j,1]) + } > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'yes',1,TRUE) > for (j in 1:5) + { + a<-table.element(a,r$stats[j,2]) + } > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/26du11359981898.tab") > tr.mns<-tapply(x1,f1,mean, trim=par3/100) > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/trimmed_mean.htm','Trimmed Mean Equation','Trimmed Mean'),2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'No Placement') > a<-table.element(a,'Placement') > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,tr.mns[1]) > a<-table.element(a,tr.mns[2]) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/3mpp81359981898.tab") > > try(system("convert tmp/1q1fp1359981898.ps tmp/1q1fp1359981898.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.847 0.230 1.093