Given a spatial point pattern inside a window, allow each point of the pattern to undergo random spatial diffusion inside the window for a specified amount of time, and return the final position of each point.
rdiffuse(X, sigma, ...)# S3 method for ppp
rdiffuse(X, sigma, ..., nsim=1, drop=TRUE,
connect = 8, method = c("C", "interpreted"), unround = TRUE)
A point pattern or a list of point patterns.
Each point pattern has the same window as X and the same number of
points as X.
Point pattern (object of class "ppp")
specifying the initial position of each point.
Equivalent standard deviation of the final position of each point, if the window were unbounded. A single positive number, or a pixel image.
Arguments passed to as.mask
controlling the spatial resolution.
Number of simulated realisations to be generated.
Logical. If nsim=1 and drop=TRUE (the default), the
result will be a point pattern, rather than a list
containing a point pattern.
Pixel grid connectivity (4 or 8).
For testing purposes only. Character string (partially matched) specifying whether to use a C language implementation or an interpreted R implementation.
Logical value specifying whether the final positions
of the points should be altered slightly
by adding a small random error to the coordinates
using rUnround. This reverses the effect of
the discretisation.
If unround=FALSE, all the final positions are exactly at the
centre of a pixel.
Adrian Baddeley [email protected].
The spatial locations of the points of X are first discretised
onto a pixel grid, with resolution specified by the arguments
....
Each point then executes a random walk on the pixel grid,
independently of other points. The final location of each point
is returned.
densityHeat.ppp
plot(solist(original=cells, diffused=rdiffuse(cells, 0.05)))
Run the code above in your browser using DataLab