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 <- c(127269 + ,75620 + ,88255 + ,104300 + ,53891 + ,23637 + ,239665 + ,26847 + ,82376 + ,108063 + ,130696 + ,106111 + ,77157 + ,156938 + ,111186 + ,193991 + ,137623 + ,129655 + ,90067 + ,118206 + ,128389 + ,226536 + ,67073 + ,89947 + ,101451 + ,121691 + ,147649 + ,101001 + ,88745 + ,145509 + ,158310 + ,82934 + ,144300 + ,50968 + ,169102 + ,129402 + ,197808 + ,102540 + ,76806 + ,135028 + ,158063 + ,97980 + ,99862 + ,49417 + ,79864 + ,238236 + ,66613 + ,133589 + ,179955 + ,104416 + ,88737 + ,24019 + ,178249 + ,64672 + ,85913 + ,149157 + ,136059 + ,147863 + ,157786 + ,97096 + ,194551 + ,166067 + ,107928 + ,136136 + ,105283 + ,74153 + ,95612 + ,108093 + ,118089 + ,51000 + ,97034 + ,52125 + ,96331 + ,106760 + ,82657 + ,159858 + ,161402 + ,90287 + ,74853 + ,87661 + ,85840 + ,224167 + ,107905 + ,82275 + ,80953 + ,90496 + ,67181 + ,155920 + ,124542 + ,84443 + ,93028 + ,106264 + ,84922 + ,132246 + ,145658 + ,106443 + ,108558 + ,138044 + ,136773 + ,183992 + ,114968 + ,126632 + ,80456 + ,39948 + ,108674 + ,101041 + ,114400 + ,153398 + ,57427 + ,78870 + ,127197 + ,119023 + ,20764 + ,99305 + ,61675 + ,72554 + ,168643 + ,21054 + ,151340 + ,23175 + ,157461 + ,103303 + ,48355 + ,51536 + ,38214 + ,86725 + ,159468 + ,90604 + ,183334 + ,137626 + ,204060 + ,114015 + ,51227 + ,147342 + ,210790 + ,41227 + ,198679 + ,81901 + ,130930 + ,82730 + ,50656 + ,195126 + ,115032 + ,173260 + ,144766 + ,57297 + ,112567 + ,142346 + ,0 + ,14688 + ,98 + ,455 + ,0 + ,0 + ,111354 + ,148268 + ,0 + ,203 + ,7199 + ,46660 + ,17547 + ,73567 + ,969 + ,76925) > par2 = '36' > par1 = '0' > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > x <- as.ts(x) > library(lattice) > postscript(file="/var/www/rcomp/tmp/1g5rs1321030714.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x,type='l',main='Run Sequence Plot',xlab='time or index',ylab='value') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2shw51321030714.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(x) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/359pw1321030714.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > if (par1 > 0) + { + densityplot(~x,col='black',main=paste('Density Plot bw = ',par1),bw=par1) + } else { + densityplot(~x,col='black',main='Density Plot') + } > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/4an9d1321030714.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(x) > grid() > dev.off() null device 1 > if (par2 > 0) + { + postscript(file="/var/www/rcomp/tmp/5y3801321030714.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + dum <- cbind(lag(x,k=1),x) + dum + dum1 <- dum[2:length(x),] + dum1 + z <- as.data.frame(dum1) + z + plot(z,main=paste('Lag plot, lowess, and regression line')) + lines(lowess(z)) + abline(lm(z)) + dev.off() + postscript(file="/var/www/rcomp/tmp/6b5dk1321030714.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + acf(x,lag.max=par2,main='Autocorrelation Function') + grid() + dev.off() + } null device 1 > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 0 75430 103800 104500 137700 239700 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Descriptive Statistics',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'# observations',header=TRUE) > a<-table.element(a,length(x)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'minimum',header=TRUE) > a<-table.element(a,min(x)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Q1',header=TRUE) > a<-table.element(a,quantile(x,0.25)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'median',header=TRUE) > a<-table.element(a,median(x)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'mean',header=TRUE) > a<-table.element(a,mean(x)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Q3',header=TRUE) > a<-table.element(a,quantile(x,0.75)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'maximum',header=TRUE) > a<-table.element(a,max(x)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/75zj81321030714.tab") > > try(system("convert tmp/1g5rs1321030714.ps tmp/1g5rs1321030714.png",intern=TRUE)) character(0) > try(system("convert tmp/2shw51321030714.ps tmp/2shw51321030714.png",intern=TRUE)) character(0) > try(system("convert tmp/359pw1321030714.ps tmp/359pw1321030714.png",intern=TRUE)) character(0) > try(system("convert tmp/4an9d1321030714.ps tmp/4an9d1321030714.png",intern=TRUE)) character(0) > try(system("convert tmp/5y3801321030714.ps tmp/5y3801321030714.png",intern=TRUE)) character(0) > try(system("convert tmp/6b5dk1321030714.ps tmp/6b5dk1321030714.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.980 0.240 3.209