[R-sig-Geo] create point density raster OR other ways to thin point data

MARCELINO DE LA CRUZ ROT marcelino.delacruz at upm.es
Sun Feb 24 20:55:17 CET 2013


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ó:
> Hi
>
> I have a set of sampling locations with a strong bias towards one
> area within my study region (e.g. many more points in the south than
> in the north). I want to "thin" sites in this high density region by
> randomly discarding sites until the density of sampling is similar to
> other areas of my study region.
>
> The approach I've come up with so far is something like:
>
> 1) calculate a kernel density or point density raster from the points
> 2) take the average "density value" of all points above (x) and below
> (y) a user-defined cutoff
> 3) for all points with an initial density value > a defined cutoff,
> randomly discard point one at a time, create a new density raster,
> recalculate the average density (x) of these points...repeat until x 
> =
> y
>
> To make this work, I'm trying to figure out how to produce a kernel
> density raster or point density raster from point data in R (akin to
> the "kernel density" and "point density" tools in ArcGIS).
>
> Can anyone point me in the right direction? I have seen the
> density.ppp function but I am unsure of how to calculate "sigma" or
> whether this function even what I need to meet my ultimate goal. Any
> alternative solutions for thinning point data are also appreciated.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
MARCELINO DE LA CRUZ ROT
Universidad Politecnica de Madrid



More information about the R-sig-Geo mailing list