[R-sig-eco] Different results from nnwhich() function

Philip Dixon pdixon at iastate.edu
Wed Nov 24 20:31:25 CET 2010


You get different results because you're giving nnwhich() different input.

nnwhich(ppp_viz, k = 1)

uses the x,y coordinates of the points.  This ignores the marks (as it should).

nnwhich(ppp_viz$marks, k = 1)

uses the integer representation of your species names.  That's what ppp_viz$marks contains.
In fact, I didn't know nnwhich() would run when given just the mark information.  ppp_viz$marks is 
not a ppp object, so nnwhich should return an error.

Best wishes,
Philip Dixon

More information about the R-sig-ecology mailing list