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(1220,1250,1350,1380,1310,1350,1360,1230,1330,1330,1380,1340,1220,1230,1400,1320,1320,1380,1340,1220,1310,1280,1330,1350,1240,1260,1340,1270,1330,1440,1350,1220,1310,1350,1300,1410,1260,1210,1410,1240,1360,1420,1310,1360,1260,1410,1330,1400,1240,1280,1460,1250,1340,1440,1170,1420,1250,1390,1260,1390,1290,1310,1540,1250,1320,1430,1080,1370,1290,1380,1260,1400,1250,1290,1550,1200,1320,1500,1060,1220,1260,1270,1280,1350,1320,1350,1530,1150,1270,1460,1000,1290,1330,1180,1350,1300,1350,1350,1540,1180,1280,1520,960,1420,1370,1210,1320,1260) > par1 = '0' > ylab = 'Dichtheid' > xlab = 'Waarde' > #'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/wessaorg/rcomp/tmp/1uk8k1312375835.ps",horizontal=F,onefile=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 (108 obs.); Bandwidth 'bw' = 28.96 x y Min. : 873.1 Min. :1.446e-06 1st Qu.:1064.1 1st Qu.:1.897e-04 Median :1255.0 Median :5.780e-04 Mean :1255.0 Mean :1.308e-03 3rd Qu.:1445.9 3rd Qu.:2.378e-03 Max. :1636.9 Max. :4.552e-03 > postscript(file="/var/wessaorg/rcomp/tmp/2ide41312375835.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3g8c61312375835.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/40o1r1312375835.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/5y2ql1312375835.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/6te1j1312375835.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/79mpb1312375835.ps",horizontal=F,onefile=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/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,'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/wessaorg/rcomp/tmp/8negi1312375835.tab") > > try(system("convert tmp/1uk8k1312375835.ps tmp/1uk8k1312375835.png",intern=TRUE)) character(0) > try(system("convert tmp/2ide41312375835.ps tmp/2ide41312375835.png",intern=TRUE)) character(0) > try(system("convert tmp/3g8c61312375835.ps tmp/3g8c61312375835.png",intern=TRUE)) character(0) > try(system("convert tmp/40o1r1312375835.ps tmp/40o1r1312375835.png",intern=TRUE)) character(0) > try(system("convert tmp/5y2ql1312375835.ps tmp/5y2ql1312375835.png",intern=TRUE)) character(0) > try(system("convert tmp/6te1j1312375835.ps tmp/6te1j1312375835.png",intern=TRUE)) character(0) > try(system("convert tmp/79mpb1312375835.ps tmp/79mpb1312375835.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.631 0.321 1.958