R version 2.8.1 (2008-12-22) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(672.1,674.4,676.6,678.7,680.8,682.9,684,684.1,684.1,684.2,685.9,689.2,692.4,695.7,697.2,696.8,696.4,695.9,696.2,697.2,705.2,706.2,707.4,708.7,710,711.3,711.5,710.7,710,709.2,707.9,706.1,704.4,702.7,701.5,700.8,700,699.3,698.8,698.4,696.8,695.1,694.3,693.4,692.4,691,689.7,688.3,686,683.6,682.6,681.9,681,679.9,678.5,677.5,678,679,679.8,681.3,684.2,687,688.4,689.5,691.1,693.3,695.9,698,699.6,701.6,703.5,705.5,708.1,709.6,710.3) > par1 = '0' > ylab = 'aantal' > xlab = 'tijd' > #'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/1o8zu1234884925.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() null device 1 > mydensity1 Call: density.default(x = x, bw = bw, kernel = "gaussian", na.rm = TRUE) Data: x (75 obs.); Bandwidth 'bw' = 4.125 x y Min. :659.7 Min. :1.745e-05 1st Qu.:675.8 1st Qu.:2.779e-03 Median :691.8 Median :1.956e-02 Mean :691.8 Mean :1.557e-02 3rd Qu.:707.8 3rd Qu.:2.562e-02 Max. :723.9 Max. :2.985e-02 > postscript(file="/var/www/html/rcomp/tmp/27rdy1234884925.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3vp3t1234884925.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4w3ua1234884925.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5esym1234884925.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6g97c1234884925.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/78shb1234884925.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() null device 1 > > #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/8feod1234884925.tab") > > system("convert tmp/1o8zu1234884925.ps tmp/1o8zu1234884925.png") > system("convert tmp/27rdy1234884925.ps tmp/27rdy1234884925.png") > system("convert tmp/3vp3t1234884925.ps tmp/3vp3t1234884925.png") > system("convert tmp/4w3ua1234884925.ps tmp/4w3ua1234884925.png") > system("convert tmp/5esym1234884925.ps tmp/5esym1234884925.png") > system("convert tmp/6g97c1234884925.ps tmp/6g97c1234884925.png") > system("convert tmp/78shb1234884925.ps tmp/78shb1234884925.png") > > > proc.time() user system elapsed 1.326 1.102 1.854