Skip to content
Prev 175414 / 398506 Next

Warning messages in Splancs package :: no non-missing arguments to min; returning Inf

On Mon, Mar 30, 2009 at 7:12 AM, D <eloquence2 at gmail.com> wrote:
Well, do some investigation. Does the error come from the kernel2d
function, or from the image function? Does it do that for any data
points? Have you read the help for kernel2d? Have you tried the
example in the help(kernel2d) text? Have you ever had it work? What
version of R are you using and so on. Please read the posting guide.

 The manual for kernel2d says that the second argument has to be "A
splancs polygon data set". But you've given it bbox(auto.spp). But
bbox returns a matrix which is the wrong structure - the columns are
min and max and the rows are X and Y. Plus it only has the corner
points, not all four points of the box which splancs says it needs.
There's also a clue in your output:

 Xrange is ?1827.026 6796.202
 Yrange is ?1853.896 6832.343

 - but if you plot the points (which you should always do, to make
sure you've read them in properly) you should see that the X range
should be 6796 to 6832 and the Y range should be 1827 to 1853.

 Solution: use the splancs bboxx() function that converts an sp-style
bounding box to a splancs-style bounding box:

 k = kernel2d(auto.spp, bboxx(bbox(auto.spp)), h0=4, nx=100, ny=100)
 image(k)

 Barry