R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(1.0137 + ,0.9834 + ,0.9643 + ,0.947 + ,0.906 + ,0.9492 + ,0.9397 + ,0.9041 + ,0.8721 + ,0.8552 + ,0.8564 + ,0.8973 + ,0.9383 + ,0.9217 + ,0.9095 + ,0.892 + ,0.8742 + ,0.8532 + ,0.8607 + ,0.9005 + ,0.9111 + ,0.9059 + ,0.8883 + ,0.8924 + ,0.8833 + ,0.87 + ,0.8758 + ,0.8858 + ,0.917 + ,0.9554 + ,0.9922 + ,0.9778 + ,0.9808 + ,0.9811 + ,1.0014 + ,1.0183 + ,1.0622 + ,1.0773 + ,1.0807 + ,1.0848 + ,1.1582 + ,1.1663 + ,1.1372 + ,1.1139 + ,1.1222 + ,1.1692 + ,1.1702 + ,1.2286 + ,1.2613 + ,1.2646 + ,1.2262 + ,1.1985 + ,1.2007 + ,1.2138 + ,1.2266 + ,1.2176 + ,1.2218 + ,1.249 + ,1.2991 + ,1.3408 + ,1.3119 + ,1.3014 + ,1.3201 + ,1.2938 + ,1.2694 + ,1.2165 + ,1.2037 + ,1.2292 + ,1.2256 + ,1.2015 + ,1.1786 + ,1.1856 + ,1.2103 + ,1.1938 + ,1.202 + ,1.2271 + ,1.277 + ,1.265 + ,1.2684 + ,1.2811 + ,1.2727 + ,1.2611 + ,1.2881 + ,1.3213 + ,1.2999 + ,1.3074 + ,1.3242 + ,1.3516 + ,1.3511 + ,1.3419 + ,1.3716 + ,1.3622 + ,1.3896 + ,1.4227 + ,1.4684 + ,1.457 + ,1.4718 + ,1.4748 + ,1.5527 + ,1.575 + ,1.5557 + ,1.5553 + ,1.577 + ,1.4975 + ,1.4369 + ,1.3322 + ,1.2732 + ,1.3449 + ,1.3239 + ,1.2785 + ,1.305 + ,1.319 + ,1.365 + ,1.4016 + ,1.4088 + ,1.4268 + ,1.4562 + ,1.4816 + ,1.4914 + ,1.4614 + ,1.4272 + ,1.3686 + ,1.3569 + ,1.3406 + ,1.2565 + ,1.2208 + ,1.277 + ,1.2894 + ,1.3067 + ,1.3898 + ,1.3661 + ,1.322 + ,1.336 + ,1.3649 + ,1.3999 + ,1.4442 + ,1.4349 + ,1.4388 + ,1.4264 + ,1.4343 + ,1.377 + ,1.3706 + ,1.3556 + ,1.3179 + ,1.2905 + ,1.3224 + ,1.3201 + ,1.3162 + ,1.2789 + ,1.2526 + ,1.2288 + ,1.24 + ,1.2856 + ,1.2974 + ,1.2828) > x <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155) > par8 = 'topo.colors' > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'y' > xlab = 'x' > main = 'Bivariate Kernel Density' > par8 <- 'cm.colors' > par7 <- 'Y' > par6 <- 'Y' > par5 <- '0' > par4 <- '0' > par3 <- '0' > par2 <- '50' > par1 <- '50' > 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 > x <- x[!is.na(y)] > y <- y[!is.na(y)] > y <- y[!is.na(x)] > x <- x[!is.na(x)] > 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/1y9q71354640269.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 0.948805 0.003487 > 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/2gean1354640269.tab") > > try(system("convert tmp/1y9q71354640269.ps tmp/1y9q71354640269.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.148 0.180 1.307