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(170588 + ,86621 + ,113337 + ,144530 + ,81530 + ,35523 + ,305115 + ,32750 + ,115885 + ,130539 + ,156990 + ,128274 + ,102350 + ,192887 + ,129796 + ,245478 + ,169569 + ,185279 + ,109598 + ,155012 + ,154730 + ,280379 + ,90938 + ,101324 + ,139502 + ,145120 + ,161729 + ,160905 + ,106888 + ,187289 + ,181853 + ,129340 + ,196862 + ,62731 + ,234863 + ,167255 + ,264528 + ,121976 + ,80964 + ,209631 + ,213310 + ,115911 + ,131337 + ,81106 + ,93125 + ,305708 + ,78800 + ,157566 + ,213487 + ,131108 + ,128734 + ,24188 + ,257662 + ,65029 + ,98066 + ,173587 + ,179571 + ,197067 + ,208823 + ,134088 + ,245107 + ,201409 + ,141760 + ,170635 + ,129100 + ,108811 + ,113450 + ,142286 + ,143937 + ,89882 + ,118807 + ,69471 + ,126630 + ,145908 + ,96981 + ,189066 + ,191467 + ,106193 + ,89318 + ,120362 + ,98791 + ,274949 + ,132798 + ,128075 + ,80953 + ,109237 + ,96634 + ,226183 + ,167226 + ,117805 + ,121630 + ,152193 + ,112004 + ,169613 + ,176577 + ,130533 + ,142339 + ,189764 + ,201603 + ,243180 + ,155931 + ,182557 + ,106351 + ,43287 + ,127394 + ,127930 + ,135306 + ,175663 + ,74112 + ,89059 + ,166142 + ,141933 + ,22938 + ,125927 + ,61857 + ,91185 + ,236316 + ,21054 + ,169093 + ,31414 + ,183059 + ,137544 + ,75032 + ,71908 + ,38214 + ,90961 + ,193662 + ,127185 + ,242153 + ,201748 + ,254599 + ,139144 + ,76470 + ,183260 + ,280039 + ,50999 + ,253056 + ,98466 + ,168059 + ,128768 + ,75746 + ,244909 + ,152366 + ,173260 + ,197033 + ,67507 + ,139409 + ,185366 + ,0 + ,14688 + ,98 + ,455 + ,0 + ,0 + ,128873 + ,185288 + ,0 + ,203 + ,7199 + ,46660 + ,17547 + ,73567 + ,969 + ,105477) > par2 = '0' > par1 = '0' > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > x <- as.ts(x) > library(lattice) > postscript(file="/var/wessaorg/rcomp/tmp/1cvo71321982312.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/24rm71321982312.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/39nci1321982312.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/4ceq91321982312.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/5xtvb1321982312.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/6ietz1321982312.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/7k5gs1321982312.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() + } > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 0 90670 130200 133300 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/8a5nn1321982312.tab") > > try(system("convert tmp/1cvo71321982312.ps tmp/1cvo71321982312.png",intern=TRUE)) character(0) > try(system("convert tmp/24rm71321982312.ps tmp/24rm71321982312.png",intern=TRUE)) character(0) > try(system("convert tmp/39nci1321982312.ps tmp/39nci1321982312.png",intern=TRUE)) character(0) > try(system("convert tmp/4ceq91321982312.ps tmp/4ceq91321982312.png",intern=TRUE)) character(0) > try(system("convert tmp/5xtvb1321982312.ps tmp/5xtvb1321982312.png",intern=TRUE)) convert: unable to open image `tmp/5xtvb1321982312.ps': No such file or directory @ blob.c/OpenBlob/2480. convert: missing an image filename `tmp/5xtvb1321982312.png' @ convert.c/ConvertImageCommand/2838. character(0) Warning message: running command 'convert tmp/5xtvb1321982312.ps tmp/5xtvb1321982312.png' had status 1 > try(system("convert tmp/6ietz1321982312.ps tmp/6ietz1321982312.png",intern=TRUE)) convert: unable to open image `tmp/6ietz1321982312.ps': No such file or directory @ blob.c/OpenBlob/2480. convert: missing an image filename `tmp/6ietz1321982312.png' @ convert.c/ConvertImageCommand/2838. character(0) Warning message: running command 'convert tmp/6ietz1321982312.ps tmp/6ietz1321982312.png' had status 1 > try(system("convert tmp/7k5gs1321982312.ps tmp/7k5gs1321982312.png",intern=TRUE)) convert: unable to open image `tmp/7k5gs1321982312.ps': No such file or directory @ blob.c/OpenBlob/2480. convert: missing an image filename `tmp/7k5gs1321982312.png' @ convert.c/ConvertImageCommand/2838. character(0) Warning message: running command 'convert tmp/7k5gs1321982312.ps tmp/7k5gs1321982312.png' had status 1 > > > proc.time() user system elapsed 1.349 0.264 1.669