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 <- c(305687 + ,305115 + ,280379 + ,280039 + ,274949 + ,264528 + ,257662 + ,254599 + ,253056 + ,245478 + ,245107 + ,244909 + ,243180 + ,242153 + ,236316 + ,234863 + ,220835 + ,213487 + ,213310 + ,209631 + ,208823 + ,201748 + ,201603 + ,201409 + ,197067 + ,197033 + ,193662 + ,192887 + ,191467 + ,190729 + ,189764 + ,189066 + ,187289 + ,185366 + ,185288 + ,185279 + ,183260 + ,183059 + ,182557 + ,181853 + ,179571 + ,176577 + ,175663 + ,173587 + ,173260 + ,170635 + ,170588 + ,169613 + ,169569 + ,169093 + ,168059 + ,167255 + ,167226 + ,166142 + ,161729 + ,160905 + ,157566 + ,156990 + ,155012 + ,154730 + ,152366 + ,152193 + ,148857 + ,145908 + ,145120 + ,144530 + ,143937 + ,142339 + ,142286 + ,141933 + ,141150 + ,139409 + ,139144 + ,137544 + ,135306 + ,134088 + ,132798 + ,131337 + ,131108 + ,130539 + ,130533 + ,130413 + ,129796 + ,129340 + ,129100 + ,128873 + ,128768 + ,128734 + ,128274 + ,128075 + ,127930 + ,127394 + ,127185 + ,126630 + ,125927 + ,121976 + ,121630 + ,120362 + ,118807 + ,117805 + ,115911 + ,115885 + ,113450 + ,113337 + ,112004 + ,109237 + ,108715 + ,107434 + ,106888 + ,106351 + ,106193 + ,105477 + ,102350 + ,101324 + ,98791 + ,98466 + ,98066 + ,96981 + ,96634 + ,93125 + ,91185 + ,90961 + ,90938 + ,89882 + ,89318 + ,89059 + ,86621 + ,81530 + ,81106 + ,80964 + ,80953 + ,78800 + ,76470 + ,75746 + ,75032 + ,74112 + ,73567 + ,71908 + ,69471 + ,67507 + ,65029 + ,62731 + ,61857 + ,50999 + ,46660 + ,43287 + ,38214 + ,35523 + ,32750 + ,31414 + ,24188 + ,22938 + ,21054 + ,17547 + ,14688 + ,7199 + ,969 + ,455 + ,203 + ,98 + ,0 + ,0 + ,0 + ,0) > par2 = '36' > par1 = '0' > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > x <- as.ts(x) > library(lattice) > postscript(file="/var/wessaorg/rcomp/tmp/1x1np1321785583.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/wessaorg/rcomp/tmp/2za391321785583.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/wessaorg/rcomp/tmp/3hjg01321785583.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/wessaorg/rcomp/tmp/4s4ym1321785583.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(x) > qqline(x) > grid() > dev.off() null device 1 > if (par2 > 0) + { + postscript(file="/var/wessaorg/rcomp/tmp/5qayk1321785583.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='Lag plot (k=1), lowess, and regression line') + lines(lowess(z)) + abline(lm(z)) + dev.off() + if (par2 > 1) { + postscript(file="/var/wessaorg/rcomp/tmp/649wp1321785583.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + dum <- cbind(lag(x,k=par2),x) + dum + dum1 <- dum[(par2+1):length(x),] + dum1 + z <- as.data.frame(dum1) + z + mylagtitle <- 'Lag plot (k=' + mylagtitle <- paste(mylagtitle,par2,sep='') + mylagtitle <- paste(mylagtitle,'), and lowess',sep='') + plot(z,main=mylagtitle) + lines(lowess(z)) + dev.off() + } + postscript(file="/var/wessaorg/rcomp/tmp/7llwl1321785583.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 90670 130100 133200 177300 305700 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/8kszh1321785583.tab") > > try(system("convert tmp/1x1np1321785583.ps tmp/1x1np1321785583.png",intern=TRUE)) character(0) > try(system("convert tmp/2za391321785583.ps tmp/2za391321785583.png",intern=TRUE)) character(0) > try(system("convert tmp/3hjg01321785583.ps tmp/3hjg01321785583.png",intern=TRUE)) character(0) > try(system("convert tmp/4s4ym1321785583.ps tmp/4s4ym1321785583.png",intern=TRUE)) character(0) > try(system("convert tmp/5qayk1321785583.ps tmp/5qayk1321785583.png",intern=TRUE)) character(0) > try(system("convert tmp/649wp1321785583.ps tmp/649wp1321785583.png",intern=TRUE)) character(0) > try(system("convert tmp/7llwl1321785583.ps tmp/7llwl1321785583.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.952 0.337 2.646