Window in which to simulate the pattern.
An object of class "owin"
or something acceptable to as.owin.
Number of attempts in the rejection method after which
the algorithm should stop trying to generate new points.
The simulated point pattern (an object of class "ppp").
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:
Ifwinis a rectangle then$n$independent random points, uniformly distributed
in the rectangle, are generated by assigning uniform random values to their
Ifwinis a binary image mask, then a random sequence of
pixels is selected (usingsample)
with equal probabilities. Then for each pixel in the sequence
we generate a uniformly distributed random point in that pixel.
Ifwinis a polygonal window, the algorithm uses the rejection
method. It finds a rectangle enclosing the window,
generates points in this rectangle, and tests whether they fall in
the desired window. It gives up whengiveup * ntests
have been performed without yieldingnsuccesses.
The algorithm for binary image masks is faster than the rejection
method but involves discretisation.