R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(66857.2,64722.8,68489.6,71342.9,63542.5,69425.0,58927.9,61009.0,66837.0,66147.6,65982.3,65527.5,65914.6,59189.9,66211.4,66400.8,60167.7,64547.9,57706.2,58642.6,60082.1,63414.8,66044.0,57628.5,62838.8,55758.6,61004.5,66173.4,57489.0,59552.2,57061.8,55895.3,56314.7,61232.8,60014.1,57685.4,60403.1,52349.7,55693.3,65676.1,54898.8,55518.2,53779.1,52340.9,55704.4,60330.3,52837.4,55388.1,60383.4,52070.3,54077.0,62887.8,49212.8,57722.0,53936.8,46991.0,54984.2,56485.1,51277.8,53596.4,54252.5,49413.0,53213.2,58695.3,48723.5,54510.0,49454.1,46136.6,54622.5,50583.0,53224.3,53056.4) > 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/www/html/rcomp/tmp/1ycgg1267641889.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 (72 obs.); Bandwidth 'bw' = 2242 x y Min. :39411 Min. :2.955e-08 1st Qu.:49075 1st Qu.:3.236e-06 Median :58740 Median :2.312e-05 Mean :58740 Mean :2.584e-05 3rd Qu.:68404 3rd Qu.:4.313e-05 Max. :78069 Max. :6.274e-05 > postscript(file="/var/www/html/rcomp/tmp/2jjxm1267641889.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/3j4n11267641889.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/4imdw1267641889.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/5nozi1267641889.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/6do8f1267641889.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/77soo1267641889.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/85uza1267641889.tab") > > try(system("convert tmp/1ycgg1267641889.ps tmp/1ycgg1267641889.png",intern=TRUE)) character(0) > try(system("convert tmp/2jjxm1267641889.ps tmp/2jjxm1267641889.png",intern=TRUE)) character(0) > try(system("convert tmp/3j4n11267641889.ps tmp/3j4n11267641889.png",intern=TRUE)) character(0) > try(system("convert tmp/4imdw1267641889.ps tmp/4imdw1267641889.png",intern=TRUE)) character(0) > try(system("convert tmp/5nozi1267641889.ps tmp/5nozi1267641889.png",intern=TRUE)) character(0) > try(system("convert tmp/6do8f1267641889.ps tmp/6do8f1267641889.png",intern=TRUE)) character(0) > try(system("convert tmp/77soo1267641889.ps tmp/77soo1267641889.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.307 1.096 1.647