x <- c(3.42,3.42,3.43,3.47,3.51,3.52,3.52,3.52,3.52,3.52,3.52,3.52,3.52,3.52,3.58,3.6,3.61,3.61,3.61,3.63,3.68,3.69,3.69,3.69,3.69,3.69,3.69,3.69,3.69,3.78,3.79,3.79,3.8,3.8,3.8,3.8,3.81,3.95,3.99,4,4.06,4.16,4.19,4.2,4.2,4.2,4.2,4.2,4.23,4.38,4.43,4.44,4.44,4.44,4.44,4.44,4.45,4.45,4.45,4.45,4.45,4.45,4.45,4.45,4.46,4.46,4.46,4.48,4.58,4.67,4.68,4.68)
par1 = '0'
ylab = '% gegevens'
xlab = 'prijs'
#'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
#Author: Prof. Dr. P. Wessa
#To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
#Source of accompanying publication: Office for Research, Development, and Education
#Technical description: 
if (par1 == '0') bw <- 'nrd0'
if (par1 != '0') bw <- as.numeric(par1)
postscript(file="/var/www/html/rcomp/tmp/15mgs1234732462.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
mydensity1<-density(x,bw=bw,kernel='gaussian',na.rm=TRUE)
plot(mydensity1,main='Gaussian Kernel',xlab=xlab,ylab=ylab)
grid()
dev.off()
mydensity1
postscript(file="/var/www/html/rcomp/tmp/2nja11234732462.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
mydensity2<-density(x,bw=bw,kernel='epanechnikov',na.rm=TRUE)
plot(mydensity2,main='Epanechnikov Kernel',xlab=xlab,ylab=ylab)
grid()
dev.off()
postscript(file="/var/www/html/rcomp/tmp/32yfl1234732462.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
mydensity3<-density(x,bw=bw,kernel='rectangular',na.rm=TRUE)
plot(mydensity3,main='Rectangular Kernel',xlab=xlab,ylab=ylab)
grid()
dev.off()
postscript(file="/var/www/html/rcomp/tmp/4dzd11234732462.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
mydensity4<-density(x,bw=bw,kernel='triangular',na.rm=TRUE)
plot(mydensity4,main='Triangular Kernel',xlab=xlab,ylab=ylab)
grid()
dev.off()
postscript(file="/var/www/html/rcomp/tmp/54bpy1234732462.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
mydensity5<-density(x,bw=bw,kernel='biweight',na.rm=TRUE)
plot(mydensity5,main='Biweight Kernel',xlab=xlab,ylab=ylab)
grid()
dev.off()
postscript(file="/var/www/html/rcomp/tmp/6l0s41234732462.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
mydensity6<-density(x,bw=bw,kernel='cosine',na.rm=TRUE)
plot(mydensity6,main='Cosine Kernel',xlab=xlab,ylab=ylab)
grid()
dev.off()
postscript(file="/var/www/html/rcomp/tmp/76eex1234732462.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
mydensity7<-density(x,bw=bw,kernel='optcosine',na.rm=TRUE)
plot(mydensity7,main='Optcosine Kernel',xlab=xlab,ylab=ylab)
grid()
dev.off()

#Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
load(file="/var/www/html/rcomp/createtable")

a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Properties of Density Trace',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Bandwidth',header=TRUE)
a<-table.element(a,mydensity1$bw)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'#Observations',header=TRUE)
a<-table.element(a,mydensity1$n)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file="/var/www/html/rcomp/tmp/8of111234732462.tab") 

system("convert tmp/15mgs1234732462.ps tmp/15mgs1234732462.png")
system("convert tmp/2nja11234732462.ps tmp/2nja11234732462.png")
system("convert tmp/32yfl1234732462.ps tmp/32yfl1234732462.png")
system("convert tmp/4dzd11234732462.ps tmp/4dzd11234732462.png")
system("convert tmp/54bpy1234732462.ps tmp/54bpy1234732462.png")
system("convert tmp/6l0s41234732462.ps tmp/6l0s41234732462.png")
system("convert tmp/76eex1234732462.ps tmp/76eex1234732462.png")

