I'm using density.ppp() to get an intensity function for a series of coordinates. The data is projected and is in units of meters. I'm trying to estimate number of points/km, so after looking at the documentation I used eps = 1000 to set the resolution of the outputted image as 1km2.
But does eps only refer to where the values are estimated? Or the units of area that the intensity function estimate is in?
Do I still need to rescale the values by 1000x1000 to get km2?
The argument eps
can in general be a two dimensional vector giving the pixel size in the x and y coordinates. If you only give one value (which is perhaps the most common usage) this size is used in both directions. Thus, your usage should give you an image with 1000 m by 1000 m pixels with intensity values. This intensity is per unit area which in your case means that the intensity values are the expected number of points in a 1 m by 1 m region. If you want to rescale your entire analysis to be in km I suggest that you first use rescale.ppp
to convert to km and then use eps=1
in density.ppp
. If your data is in a ppp
object X
you should do:
Y <- rescale(X, 1000, unitname = "km")
density(Y, eps = 1)
I don't remember which internal functions are called by density.ppp
to pass eps
to as.mask, but if you really need to know I can investigate further.