| rlpp {spatstat.linnet} | R Documentation |
Random Points on a Linear Network
Description
Generates n independent random points
on a linear network with a specified probability density.
Usage
rlpp(n, f, ..., nsim=1, drop=TRUE)
Arguments
n |
Number of random points to generate. A nonnegative integer giving the number of points, or an integer vector giving the numbers of points of each type. |
f |
Probability density (not necessarily normalised).
A pixel image on a linear network (object of class |
... |
Additional arguments passed to |
nsim |
Number of simulated realisations to generate. |
drop |
Logical value indicating what to do when |
Details
The linear network L, on which the points will be generated,
is determined by the argument f.
If f is a function, it is converted to a pixel image
on the linear network, using any additional function arguments
....
If n is a single integer and f is a function or pixel image,
then independent random points are generated on L with
probability density proportional to f.
If n is an integer vector and f is a list of functions
or pixel images, where n and f have the same length,
then independent random points of several types are generated on
L, with n[i] points of type i having probability
density proportional to f[[i]].
Value
If nsim = 1 and drop=TRUE,
a point pattern on the linear network,
i.e.\ an object of class "lpp".
Otherwise, a list of such point patterns.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
See Also
Examples
g <- function(x, y, seg, tp) { exp(x + 3*y) }
f <- linfun(g, simplenet)
rlpp(20, f)
plot(rlpp(20, f, nsim=3))