R version 2.8.0 (2008-10-20) 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(99.5,93.5,104.6,95.3,102.8,103.3,100.2,107.9,107.5,119.8,112,102.1,105.3,101.3,108.4,107.4,109.1,109.5,111.4,110.1,117,129.6,113.5,113.3,110.1,107.4,110.1,112.5,106,117.6,117.8,113.5,121.2,130.4,115.2,117.9,110.7,107.6,124.3,115.1,112.5,127.9,117.4,119.3,130.4,126,125.4,130.5,115.9,108.7,124,119.4,118.6,131.3,111.1,124.8,132.3,126.7,131.7,130.9,122.1,113.2,133.6,119.2,129.4,131.4,117.1,130.5,132.3,140.8,137.5,128.6,126.7,120.8,139.3,128.6,131.3,136.3,128.8,133.2,136.3,151.1,145,134.4) > x <- c(2648.9,2669.6,3042.3,2604.2,2732.1,2621.7,2483.7,2479.3,2684.6,2834.7,2566.1,2251.2,2350,2299.8,2542.8,2530.2,2508.1,2616.8,2534.1,2181.8,2578.9,2841.9,2529.9,2103.2,2326.2,2452.6,2782.1,2727.3,2648.2,2760.7,2613,2225.4,2713.9,2923.3,2707,2473.9,2521,2531.8,3068.8,2826.9,2674.2,2966.6,2798.8,2629.6,3124.6,3115.7,3083,2863.9,2728.7,2789.4,3225.7,3148.2,2836.5,3153.5,2656.9,2834.7,3172.5,2998.8,3103.1,2735.6,2818.1,2874.4,3438.5,2949.1,3306.8,3530,3003.8,3206.4,3514.6,3522.6,3525.5,2996.2,3231.1,3030,3541.7,3113.2,3390.8,3424.2,3079.8,3123.4,3317.1,3579.9,3317.9,2668.1) > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'Uitvoer' > xlab = 'Voedingproductie' > 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/1jm021229274571.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 42.44152 0.02699 > 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/2zg3n1229274571.tab") > > system("convert tmp/1jm021229274571.ps tmp/1jm021229274571.png") > > > proc.time() user system elapsed 0.614 0.286 0.821