x <- c(77,70,76,77,73,71,64,75,101,75,124,66,70,100,73,76,65,69,86,67,80,80,82,66,85,73,107,66,64,74,70,58,69,71,76,98,76,66,70,70,56,61,66,68,86,71,87,101,63,90,79,67,83,94,76,66,77,73,66,89,84,91,83,68,86,58,68,58,95,75,61,66,64,68,67,82,68,78,66,70,75,93,86,71,80,66,91,81)
par1 = '10'
xlab = 'Survey Score'
main = ''
postscript(file="/var/wessaorg/rcomp/tmp/12s5a1338543743.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
par1 <- as.numeric(par1)
myhist<-hist(x, breaks=par1, col=2, xlab=xlab, main=main)
dev.off()
postscript(file="/var/wessaorg/rcomp/tmp/2x7sv1338543743.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
qqnorm(x)
qqline(x, col=2)
dev.off()
postscript(file="/var/wessaorg/rcomp/tmp/34uhw1338543743.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
plot(density(x), xlab=xlab, main=main)
dev.off()

#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',3,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'mean',header=TRUE)
a<-table.element(a,signif(mean(x), 6))
a<-table.element(a,hyperlink('http://www.xycoon.com/arithmetic_mean.htm','formula','click to see the formula'))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'standard deviation',header=TRUE)
a<-table.element(a,signif(sd(x), 6))
a<-table.element(a,hyperlink('http://www.xycoon.com/unbiased1.htm','formula','click to see the formula'))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file="/var/wessaorg/rcomp/tmp/4o6pp1338543743.tab") 

try(system("convert tmp/12s5a1338543743.ps tmp/12s5a1338543743.png",intern=TRUE))
try(system("convert tmp/2x7sv1338543743.ps tmp/2x7sv1338543743.png",intern=TRUE))
try(system("convert tmp/34uhw1338543743.ps tmp/34uhw1338543743.png",intern=TRUE))

