runifpointOnLines: Generate N Uniform Random Points On Line Segments

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/randomonlines.R

Description

Given a line segment pattern, generate a random point pattern consisting of n points uniformly distributed on the line segments.

Usage

1
runifpointOnLines(n, L, nsim=1)

Arguments

n

Number of points to generate.

L

Line segment pattern (object of class "psp") on which the points should lie.

nsim

Number of simulated realisations to be generated.

Details

This command generates a point pattern consisting of n independent random points, each point uniformly distributed on the line segment pattern. This means that, for each random point,

If n is a single integer, the result is an unmarked point pattern containing n points. If n is a vector of integers, the result is a marked point pattern, with m different types of points, where m = length(n), in which there are n[j] points of type j.

Value

If nsim = 1, a point pattern (object of class "ppp") with the same window as L. If nsim > 1, a list of point patterns.

Author(s)

\adrian

and \rolf

See Also

psp, ppp, pointsOnLines, runifpoint

Examples

1
2
3
4
5
  X <- psp(runif(10), runif(10), runif(10), runif(10),  window=owin())
  Y <- runifpointOnLines(20, X)
  plot(X, main="")
  plot(Y, add=TRUE)
  Z <- runifpointOnLines(c(5,5), X)

spatstat documentation built on May 30, 2017, 7:53 a.m.

Search within the spatstat package
Search all R packages, documentation and source code