R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(101.02,101.15,101.51,101.75,101.8,101.8,101.8,101.82,101.99,102.25,102.34,102.35,102.35,102.39,102.49,102.67,102.68,102.7,102.71,102.72,102.83,102.92,103.04,103.08,103.09,103.11,103.18,103.18,103.22,103.25,103.25,103.25,103.47,103.57,103.66,103.7,103.7,103.75,103.85,104.02,104.13,104.17,104.18,104.2,104.5,104.78,104.88,104.89,104.9,104.95,105.24,105.35,105.44,105.46,105.47,105.48,105.75,106.1,106.19,106.23,106.24,106.25,106.35,106.48,106.52,106.55,106.55,106.56,106.89,107.09,107.24,107.28,107.3,107.31,107.47,107.35,107.31,107.32,107.32,107.34,107.53,107.72,107.75,107.79,107.81,107.9,107.8,107.86,107.8,107.74,107.75,107.83,107.8,107.81,107.86,107.83) > 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/rcomp/tmp/15ab21286286546.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 (96 obs.); Bandwidth 'bw' = 0.7768 x y Min. : 98.69 Min. :0.0001142 1st Qu.:101.57 1st Qu.:0.0210382 Median :104.46 Median :0.1050573 Mean :104.46 Mean :0.0865480 3rd Qu.:107.35 3rd Qu.:0.1379247 Max. :110.23 Max. :0.1647759 > postscript(file="/var/www/rcomp/tmp/25ab21286286546.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/rcomp/tmp/3gjan1286286546.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/rcomp/tmp/4gjan1286286546.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/rcomp/tmp/5gjan1286286546.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/rcomp/tmp/69ts81286286546.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/rcomp/tmp/79ts81286286546.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/8ctqe1286286546.tab") > > try(system("convert tmp/15ab21286286546.ps tmp/15ab21286286546.png",intern=TRUE)) character(0) > try(system("convert tmp/25ab21286286546.ps tmp/25ab21286286546.png",intern=TRUE)) character(0) > try(system("convert tmp/3gjan1286286546.ps tmp/3gjan1286286546.png",intern=TRUE)) character(0) > try(system("convert tmp/4gjan1286286546.ps tmp/4gjan1286286546.png",intern=TRUE)) character(0) > try(system("convert tmp/5gjan1286286546.ps tmp/5gjan1286286546.png",intern=TRUE)) character(0) > try(system("convert tmp/69ts81286286546.ps tmp/69ts81286286546.png",intern=TRUE)) character(0) > try(system("convert tmp/79ts81286286546.ps tmp/79ts81286286546.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.030 1.430 3.483