R version 2.7.2 (2008-08-25) Copyright (C) 2008 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. > y <- c(2894.3,2838.1,3137.7,2703.7,2623.6,2691.1,2577.9,2430.5,2871,2922.5,2810.8,3070.3,2790,2821,3383.6,3038.4,2877.3,3283.7,2927.3,2952.5,3328.9,3467.3,3355.6,3707,3275.6,3466.5,4054.3,3708.5,3339,3559.8,3189.2,3620.7,3915.4,3804.3,4391.6,4975.9,4478.7,4455.8,5661.8,4062.8,4257.7,4114.2,3793.8,4170,4004.9,4129.7,4116,4133.8,4081.2,3854.1,4239.8,3718.5,4183.1,4336.1,4299.2,4285.3,4676.7,4980.6,5207.4,5221.7) > x <- c(2333.3,2282.2,2458.2,2345.5,2065.2,2332.5,2077.5,1691.4,2381.9,2526,2212.1,2459.9,2178.8,2318.2,2661.8,2407.9,2040.6,2601.6,2106.3,1829.9,2546.1,2363,2435.8,2668,2316.9,2324.2,2610.8,2413.2,2345.2,2590.8,2132.1,1990.7,2641.7,2437.1,2649.2,2819.4,2405.6,2451.3,2878.5,2534.1,2670.6,2909.7,2261.8,2135.3,2870.4,2803.2,2775.1,2633.7,2930.6,2779.7,3039.2,2752.7,2743.1,2914,2711.9,2295.8,2840.6,3230.5,2761.1,2769.6) > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'Invoer Nederland' > xlab = 'Invoer Frankrijk' > main = 'Bivariate Kernel Density' > #'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: Write here your technical program description (don't use hard returns!) > 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.22 installed Copyright M. P. Wand 1997 Loading GenKern version 1.1 Copyright Lucy and Aykroyd 2000 last update October 2004 requires KernSmooth Package GenKern installed > 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 > postscript(file="/var/www/html/rcomp/tmp/1s0ce1226407142.ps",horizontal=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=terrain.colors(100), 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 -670.270 1.747 > abline(r) > box() > 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,'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/www/html/rcomp/tmp/25iwf1226407142.tab") > > system("convert tmp/1s0ce1226407142.ps tmp/1s0ce1226407142.png") > > > proc.time() user system elapsed 0.756 0.247 0.826