Skip to content
Prev 17561 / 29559 Next

create point density raster OR other ways to thin point data

Hi,

you can combine density.ppp and rthin to thin inversely to the density 
of points. See this example

# example of a heterogeneous point pattern
library(spatstat)
data(lansing)
maple<-lansing[lansing$marks=="maple"]
plot(maple)
maple.dens<- density(maple)
plot(maple.dens)

# get the probability of retention as inversely proportional to the 
density

maple.p <- eval.im(1-(maple.dens/max(maple.dens)))
plot(maple.p)

# Thin your pp
plot(rthin(maple, maple.p))

Sigma us calculted by default by density.ppp but you can set your aown 
sigma also (see the help page of density.ppp)


HTH,
Marcelino

El 2013-02-24 19:38, Julie Lee-Yaw escribi?: