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(860,950,780,840,840,900,860,810,870,930,790,930,820,930,730,860,800,890,850,890,850,1040,740,940,790,920,770,780,770,890,890,860,830,1020,740,940,780,860,820,760,780,900,820,980,830,930,770,960,750,850,850,820,730,960,760,940,880,890,830,850,850,860,800,840,760,910,650,990,780,910,820,780,890,810,830,890,760,860,670,940,740,920,800,800,920,810,790,850,780,900,710,960,760,920,740,800,870,740,710,900,740,880,700,1040,880,900,820,740) > par1 = '0' > ylab = 'Density' > xlab = 'Value' > #'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/1bf7a1313421706.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.05 x y Min. : 565.8 Min. :1.620e-06 1st Qu.: 705.4 1st Qu.:2.446e-04 Median : 845.0 Median :1.099e-03 Mean : 845.0 Mean :1.789e-03 3rd Qu.: 984.6 3rd Qu.:3.641e-03 Max. :1124.2 Max. :4.343e-03 > postscript(file="/var/wessaorg/rcomp/tmp/2whd01313421706.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/36b5n1313421706.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/44whb1313421706.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/55ayk1313421706.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/6dkeb1313421706.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/736fo1313421706.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/8q1m21313421706.tab") > > try(system("convert tmp/1bf7a1313421706.ps tmp/1bf7a1313421706.png",intern=TRUE)) character(0) > try(system("convert tmp/2whd01313421706.ps tmp/2whd01313421706.png",intern=TRUE)) character(0) > try(system("convert tmp/36b5n1313421706.ps tmp/36b5n1313421706.png",intern=TRUE)) character(0) > try(system("convert tmp/44whb1313421706.ps tmp/44whb1313421706.png",intern=TRUE)) character(0) > try(system("convert tmp/55ayk1313421706.ps tmp/55ayk1313421706.png",intern=TRUE)) character(0) > try(system("convert tmp/6dkeb1313421706.ps tmp/6dkeb1313421706.png",intern=TRUE)) character(0) > try(system("convert tmp/736fo1313421706.ps tmp/736fo1313421706.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.696 0.399 2.098