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(56,55,54,52,72,71,56,46,47,47,48,50,44,38,33,33,52,54,39,22,31,31,38,42,41,31,36,34,51,47,31,19,30,33,36,40,32,25,28,29,55,55,40,38,44,41,49,59,61,47,43,39,66,68,63,68,67,59,68,78,82,70,62,68,94,102,100,104,103,93,110,114,120,102,95,103,122,139,135,135,137,130,148,148,145,128,131,133,146,163,151,157,152,149,172,167,160,150,160,165,171,179,171,176,170,169,194,196,188,174,186,191,197,206,197,204,201,190,213,213) > par1 = '0' > ylab = 'dichtheid' > xlab = 'omzet' > #'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/1lnig1279887268.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 (120 obs.); Bandwidth 'bw' = 20.26 x y Min. :-41.78 Min. :5.563e-06 1st Qu.: 37.11 1st Qu.:7.293e-04 Median :116.00 Median :3.338e-03 Mean :116.00 Mean :3.166e-03 3rd Qu.:194.89 3rd Qu.:4.220e-03 Max. :273.78 Max. :8.474e-03 > postscript(file="/var/www/html/rcomp/tmp/2efz11279887268.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/3efz11279887268.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/4ooy31279887268.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/5ooy31279887268.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/6ooy31279887268.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/7zxyp1279887268.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/8kfec1279887268.tab") > > try(system("convert tmp/1lnig1279887268.ps tmp/1lnig1279887268.png",intern=TRUE)) character(0) > try(system("convert tmp/2efz11279887268.ps tmp/2efz11279887268.png",intern=TRUE)) character(0) > try(system("convert tmp/3efz11279887268.ps tmp/3efz11279887268.png",intern=TRUE)) character(0) > try(system("convert tmp/4ooy31279887268.ps tmp/4ooy31279887268.png",intern=TRUE)) character(0) > try(system("convert tmp/5ooy31279887268.ps tmp/5ooy31279887268.png",intern=TRUE)) character(0) > try(system("convert tmp/6ooy31279887268.ps tmp/6ooy31279887268.png",intern=TRUE)) character(0) > try(system("convert tmp/7zxyp1279887268.ps tmp/7zxyp1279887268.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.298 1.055 1.944