spatstat.linnet (version 3.1-5)

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)

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.

Arguments

n

Number of random points to generate. A nonnegative integer, or a vector of integers specifying the number of points of each type.

L

A linear network (object of class "linnet", see linnet).

nsim

Number of simulated realisations to generate.

drop

Logical value indicating what to do when 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.

ex

Optional. A point pattern on a network (object of class "lpp") which serves as an example to determine the default values of n and L. See Details.

Author

Ang Qi Wei aqw07398@hotmail.com and Adrian Baddeley Adrian.Baddeley@curtin.edu.au

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