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(545.33,545.61,548.22,559.38,568.86,569.92,569.92,577.08,580.7,584.72,593.34,593.05,593.05,594.05,598.98,604.55,614.43,615.08,615.08,614.7,614.57,630.28,639.64,640.14,640.14,642.71,644.67,645.84,648.2,652.59,652.59,655.43,659.02,661.41,662.23,660.69,660.69,660.4,660.76,664.45,666.27,666.04,666.04,667.91,669.98,672.32,681.21,679.7,679.69,679.69,679.98,682.23,681.14,671.18,671.18,671.96,671.6,672.28,669.35,668.85,668.85,670.28,674.71,678.77,683.52,683.7,683.74,684.48,686.58,696.44,701.93,704.36,704.36,704.11,707.08,713.6,713.15,713.16,713.18,714.84,716.81,724.19,730.08,731.48,731.58,732.77,736.74,738.89,743.79,744.29,744.5,746.59,747.73,757.59,766.78,771.28) > 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/196hb1286304876.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' = 17.26 x y Min. :493.5 Min. :4.148e-06 1st Qu.:575.9 1st Qu.:6.963e-04 Median :658.3 Median :2.778e-03 Mean :658.3 Mean :3.032e-03 3rd Qu.:740.7 3rd Qu.:4.346e-03 Max. :823.1 Max. :9.257e-03 > postscript(file="/var/www/html/rcomp/tmp/2jxhe1286304876.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/3jxhe1286304876.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/4coyh1286304876.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/5coyh1286304876.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/6mff21286304876.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/7mff21286304876.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/8xpxn1286304876.tab") > > try(system("convert tmp/196hb1286304876.ps tmp/196hb1286304876.png",intern=TRUE)) character(0) > try(system("convert tmp/2jxhe1286304876.ps tmp/2jxhe1286304876.png",intern=TRUE)) character(0) > try(system("convert tmp/3jxhe1286304876.ps tmp/3jxhe1286304876.png",intern=TRUE)) character(0) > try(system("convert tmp/4coyh1286304876.ps tmp/4coyh1286304876.png",intern=TRUE)) character(0) > try(system("convert tmp/5coyh1286304876.ps tmp/5coyh1286304876.png",intern=TRUE)) character(0) > try(system("convert tmp/6mff21286304876.ps tmp/6mff21286304876.png",intern=TRUE)) character(0) > try(system("convert tmp/7mff21286304876.ps tmp/7mff21286304876.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.311 1.092 1.749