[R-sig-Geo] Spatstat- nearest neighbour correlation, nncorr

Tom_R tom.richardson at bristol.ac.uk
Thu Apr 29 22:21:51 CEST 2010


Hi R users,

In the package Spatstat, I'd like to apply 'nncorr' to a point pattern (with
continuous marks), like this:

NNcorrel <- nncorr(pattern) *

However, I'm getting this error: "Error in nncorr(pattern) : Insufficient
data". This error is not because there are no points inside the window
(there are always >= 2 points). I think the error occurs because the mean
nearest neighbour distance is above a critical value. This critical value
seems to be the same as the 'range' argument that's used in the 'markcorr'
and 'pcf' R functions. I don't really understand why nncorr returns an error
when the points are far apart... 

So the question is, how do I tell nncorr to measure the correlation between
nearest-neighbours, IRRESPECTIVE of the mean nearest neighbour distance  ??

Thanks!
Tom

* actually I'm using a special correlation function for angular marks (see
help(markcorr) for details): 
NNcorrel <- nncorr(pattina, function(m1,m2) {sin(m1-m2)^2})
However, that's not particularly relevant as both this & the simpler version
given above return the same error.

-- 
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Spatstat-nearest-neighbour-correlation-nncorr-tp4982162p4982162.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list