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. > y <- c(11.54,25.47,34.78,29.21,43.9,33.47,55.10,48.13,33.25,25.33,26.98,88.74,36.54,11.78,29.11,32.47,36.99,27.55,18.55,14.33,8.78,40.55,22.63,20.47,60.03,50.14,30.63,36.99,27.55,18.55,14.33,21.63,36.12,23.69,54.12,45.16,69.41,41.96,13.25,26.98,88.74,36.54,11.78,29.11,32.47,55.17,17.66,19.64,44.47,50.17,21.63,36.12,23.69,33.25,25.33,26.98,14.33,8.78,17.66,19.64,13.25,16.17,9.66,20.45,24.21,19.65,21.25,33.64,25.44,60.74,71.33,55.21,66.23,19.65,23.52,25.64,19.33,20.64,18.98,15.67,20.00,11.47,28.65,24.14,19.87,17.65,30.54,28.57,29.65,31.22,32.00,19.64,41.88,45.98,34.12,30.88,25.96,20.33,26.98,27.12,21.66,27.96,28.63,29.10,34.25,39.77,41.23,14.10,19.54,8.78,24.55,34.87,31.47,21.65,19.77,9.23,7.55,22.44,16.89,47.55) > x <- c(14.69,20.15,11.78,21.47,17.54,21.47,18.55,14.33,8.78,17.66,19.64,13.25,16.17,9.66,20.45,24.21,19.65,21.33,14.47,16.22,16.66,19.87,14.55,19.41,20.63,9.12,8.36,19.36,25.78,14.66,27.55,22.63,30.33,22.22,11.99,9.47,10.33,15.36,14.99,17.31,18.94,16.54,18.21,11.74,17.41,9.99,21.14,19.70,14.87,19.65,27.65,13.45,20.00,13.47,18.54,20.00,11.47,28.65,24.14,19.87,17.65,13.69,15.47,11.63,10.24,13.54,11.00,19.74,21.25,29.54,11.41,10.87,8.47,12.69,10.14,18.63,22.54,17.65,16.41,17.65,19.87,21.45,22.65,20.69,23.74,20.96,18.35,17.84,20.54,21.63,27.61,19.47,23.52,25.64,19.33,20.64,18.98,15.67,23.74,22.89,24.66,29.40,19.87,17.55,15.94,21.74,23.51,24.84,18.47,21.01,16.74,27.45,19.54,17.74,21.65,24.74,26.89,23.22,20.16,21.88) > par8 = 'terrain.colors' > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'y' > xlab = 'x' > main = 'Bivariate Kernel Density' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2011, 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: > #Technical description: > par1 <- as(par1,'numeric') > par2 <- as(par2,'numeric') > par3 <- as(par3,'numeric') > par4 <- as(par4,'numeric') > par5 <- as(par5,'numeric') > library('GenKern') Loading required package: KernSmooth KernSmooth 2.23 loaded Copyright M. P. Wand 1997-2009 > if (par3==0) par3 <- dpik(x) > if (par4==0) par4 <- dpik(y) > if (par5==0) par5 <- cor(x,y) > if (par1 > 500) par1 <- 500 > if (par2 > 500) par2 <- 500 > if (par8 == 'terrain.colors') mycol <- terrain.colors(100) > if (par8 == 'rainbow') mycol <- rainbow(100) > if (par8 == 'heat.colors') mycol <- heat.colors(100) > if (par8 == 'topo.colors') mycol <- topo.colors(100) > if (par8 == 'cm.colors') mycol <- cm.colors(100) > postscript(file="/var/wessaorg/rcomp/tmp/1jqte1321297689.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- KernSur(x,y, xgridsize=par1, ygridsize=par2, correlation=par5, xbandwidth=par3, ybandwidth=par4) > image(op$xords, op$yords, op$zden, col=mycol, axes=TRUE,main=main,xlab=xlab,ylab=ylab) > if (par6=='Y') contour(op$xords, op$yords, op$zden, add=TRUE) > if (par7=='Y') points(x,y) > (r<-lm(y ~ x)) Call: lm(formula = y ~ x) Coefficients: (Intercept) x 41.3940 -0.6277 > abline(r) > box() > 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,'Bandwidth',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'x axis',header=TRUE) > a<-table.element(a,par3) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'y axis',header=TRUE) > a<-table.element(a,par4) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Correlation',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'correlation used in KDE',header=TRUE) > a<-table.element(a,par5) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'correlation(x,y)',header=TRUE) > a<-table.element(a,cor(x,y)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/2mlha1321297689.tab") > > try(system("convert tmp/1jqte1321297689.ps tmp/1jqte1321297689.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.990 0.159 5.230