lengths.psp: Lengths of Line Segments

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

View source: R/psp.R

Description

Computes the length of each line segment in a line segment pattern.

Usage

1
  lengths.psp(x, squared=FALSE)

Arguments

x

A line segment pattern (object of class "psp").

squared

Logical value indicating whether to return the squared lengths (squared=TRUE) or the lengths themselves (squared=FALSE, the default).

Details

The length of each line segment is computed and the lengths are returned as a numeric vector.

Using squared lengths may be more efficient for some purposes, for example, to find the length of the shortest segment, sqrt(min(lengths.psp(x, squared=TRUE))) is faster than min(lengths.psp(x)).

Value

Numeric vector.

Author(s)

\adrian

and \rolf

See Also

summary.psp, midpoints.psp, angles.psp

Examples

1
2
  a <- psp(runif(10), runif(10), runif(10), runif(10), window=owin())
  b <- lengths.psp(a)   

spatstat documentation built on June 15, 2018, 9:04 a.m.