rlpp(n, f, ..., nsim=1, drop=TRUE)
"linim"
)
or a function on a linear network (object of class "linfun"
).
Alternatively, f
can be a list of functions or pixel images,
giving the densities of points of each type.
f
if it is a function
or a list of functions.
nsim=1
.
If drop=TRUE
(the default), the result is a point pattern.
If drop=FALSE
, the result is a list with one entry which is a
point pattern.
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.
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]]
.
runiflpp
g <- function(x, y, seg, tp) { exp(x + 3*y) }
f <- linfun(g, simplenet)
rlpp(20, f)
plot(rlpp(20, f, nsim=3))
Run the code above in your browser using DataLab