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(15.73,16.17,12.00,12.86,10.30,12.97,12.06,10.49,5.97,9.26,9.74,5.46,2.71,3.90,1.51,5.01,2.96,-1.97,-4.61,4.27,4.01,0.04,3.04,2.29,4.37,6.39,5.74,7.64,7.07,6.23,10.20,14.07,12.83,12.04,11.97,12.63,13.56,15.66,16.34,14.09,15.03,16.09,19.27,22.50,16.07,19.11,18.66,18.29,20.26,19.20,20.10,17.93,16.11,16.90,16.14,15.04,13.41,14.14,9.59,10.74,11.67,8.09,10.07,11.80,12.01,6.61,6.47,-3.11,1.94,1.10,-3.40,1.64,3.11,-0.16,3.80,-2.39,1.51,7.24,2.00,2.11,10.54,11.10,7.34,9.53,9.71,10.14,13.93,8.33,8.31,13.83,14.50,16.71,16.49,14.57,19.04,22.84,22.23,19.56,19.76,18.36,16.99,16.87,18.50,16.51) > par2 = '2' > par1 = '0' > par2 = 52 > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > x <- as.ts(x) > library(lattice) > postscript(file="/var/www/rcomp/tmp/1khxn1292924211.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/2vqwq1292924211.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/3vqwq1292924211.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/45zwb1292924211.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/www/rcomp/tmp/55zwb1292924211.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/www/rcomp/tmp/6yqve1292924211.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/www/rcomp/tmp/79ich1292924211.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. -4.61 5.67 11.38 10.57 16.10 22.84 > > #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/8gj9t1292924211.tab") > > try(system("convert tmp/1khxn1292924211.ps tmp/1khxn1292924211.png",intern=TRUE)) character(0) > try(system("convert tmp/2vqwq1292924211.ps tmp/2vqwq1292924211.png",intern=TRUE)) character(0) > try(system("convert tmp/3vqwq1292924211.ps tmp/3vqwq1292924211.png",intern=TRUE)) character(0) > try(system("convert tmp/45zwb1292924211.ps tmp/45zwb1292924211.png",intern=TRUE)) character(0) > try(system("convert tmp/55zwb1292924211.ps tmp/55zwb1292924211.png",intern=TRUE)) character(0) > try(system("convert tmp/6yqve1292924211.ps tmp/6yqve1292924211.png",intern=TRUE)) character(0) > try(system("convert tmp/79ich1292924211.ps tmp/79ich1292924211.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.95 1.18 3.08