rUnround: Random Un-Rounding of Spatial Location

View source: R/random.R

rUnroundR Documentation

Random Un-Rounding of Spatial Location

Description

Given a point pattern in which the spatial coordinates have been discretised (rounded), randomly displace each point to reverse the effect of rounding.

Usage

rUnround(X, ...)

## S3 method for class 'ppp'
rUnround(X, ..., xstep=NULL, ystep=xstep, 
    nsim = 1, drop=TRUE, giveup = 1000)

Arguments

X

Point pattern (object of class "ppp").

...

Arguments passed to as.mask specifying the discretisation, if xstep and ystep are not given.

xstep, ystep

Numeric values giving the resolution of the discretised coordinates.

giveup

Maximum number of attempts to place a point inside the window.

nsim

Number of simulated realisations of the unrounded pattern.

drop

Logical value specifying, when nsim=1, whether to return a point pattern (drop=TRUE, the default) or a list containing one point pattern (drop=FALSE).

Details

This function is similar to rjitter except that it is designed to reverse the effect of discretisation of coordinates.

The spatial coordinates of X are modified by adding independent, uniformly distributed random numbers to the x and y coordinates. If the points of X were all located at the centres of pixels in a pixel grid, then the points of rUnround(X) will be uniformly randomly distributed within the same pixels.

Value

Another point pattern (object of class "ppp") in the same window as X and with the same number of points as X.

Author(s)

\adrian

.

See Also

rjitter, discretise

Examples

  X <- runifrect(30, Frame(letterR))[letterR]
  Y <- discretise(X, eps=0.05)
  Z <- rUnround(Y)

spatstat.random documentation built on May 24, 2026, 9:07 a.m.