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. > y <- c(11,12,15,10,12,11,5,16,11,15,12,9,11,15,12,16,14,11,10,7,11,10,11,16,14,12,12,11,6,14,9,15,12,12,9,13,15,11,10,13,16,13,14,14,16,9,8,8,12,10,16,13,11,14,15,8,9,17,9,13,6,13,8,12,13,14,11,15,7,16,16,14,11,13,13,7,15,11,15,13,11,12,10,12,12,12,14,6,14,15,8,12,10,15,11,9,14,10,16,5,8,13,16,16,14,14,10,9,14,8,8,16,12,9,15,12,14,12,16,12,14,8,15,16,12,4,8,11,4,14,14,13,14,7,19,12,10,14,16,11,16,12,12,16,12) > x <- c(11,8,12,10,7,6,8,16,8,16,7,11,16,16,12,13,19,7,8,12,13,11,8,16,15,11,12,7,9,15,6,14,14,7,15,14,17,14,5,14,8,8,13,14,16,11,10,10,10,8,14,14,12,13,5,10,6,15,12,16,15,12,8,14,14,13,12,15,8,16,14,13,15,7,5,7,13,14,14,13,11,15,13,14,13,9,8,6,13,16,7,11,8,13,5,8,10,9,16,4,4,11,14,15,17,10,15,11,15,10,9,14,15,9,12,10,16,15,14,12,15,9,12,15,6,4,8,10,6,12,14,11,15,13,15,16,4,15,12,15,15,14,14,14,11) > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'Popularity' > xlab = 'KnowingPeople' > 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.23 loaded Copyright M. P. Wand 1997-2009 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/198m81292617660.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=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 6.2906 0.4925 > 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/2oikz1292617660.tab") > > try(system("convert tmp/198m81292617660.ps tmp/198m81292617660.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.617 0.296 1.422