Learn R Programming

spatstat.linnet (version 3.5-0)

runiflpp: Uniform Random Points on a Linear Network

Description

Generates \(n\) random points, independently and uniformly distributed, on a linear network.

Usage

runiflpp(n, L, nsim=1, drop=TRUE, ex=NULL)

Arguments

Value

If nsim = 1 and drop=TRUE, a point pattern on a linear network (object of class "lpp"). Otherwise, a list of such point patterns.

Details

The specified number n of random points is generated with uniform distribution on the network L. The random points are generated using runifpointOnLines.

If n is an integer vector, then a multitype point pattern is generated, with n[i] random points of type i.

If ex is given, then it serves as an example for determining n and L. The default value of n will be the number of points in ex (or the number of points of each type in ex if it is multitype). The default value of L will be the network on which ex is defined.

See Also

rlpp for non-uniform random points; rpoislpp for Poisson point process;

lpp, linnet

Examples

Run this code
   X <- runiflpp(10, simplenet)
   plot(X)
  # marked
   Z <- runiflpp(c(a=10, b=3), simplenet)
  # using 'ex' 
   U <- runiflpp(ex=Z)

Run the code above in your browser using DataLab