runifpoint {spatstat}R Documentation

Generate N Uniform Random Points

Description

Generate a random point pattern containing n independent uniform random points.

Usage

 runifpoint(n, win=owin(c(0,1),c(0,1)), giveup=1000)

Arguments

n Number of points.
win Window in which to simulate the pattern. An object of class "owin" or something acceptable to as.owin.
giveup Number of attempts in the rejection method after which the algorithm should stop trying to generate new points.

Details

This function generates n independent random points, uniformly distributed in the window win. (For nonuniform distributions, see rpoint.)

The algorithm depends on the type of window, as follows:

The algorithm for binary image masks is faster than the rejection method but involves discretisation.

Value

The simulated point pattern (an object of class "ppp").

Author(s)

Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf

See Also

ppp.object, owin.object, rpoispp, rpoint

Examples

 # 100 random points in the unit square
 pp <- runifpoint(100)
 # irregular window
 data(letterR)
 # polygonal
 pp <- runifpoint(100, letterR)
 # binary image mask
 pp <- runifpoint(100, as.mask(letterR))

[Package spatstat version 1.11-3 Index]