Learn R Programming

spatstat.geom (version 3.8-2)

lengths_psp: Lengths of Line Segments

Description

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

Usage

lengths_psp(x, squared=FALSE)

Arguments

Value

Numeric vector.

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)).

See Also

marks.psp, summary.psp, midpoints.psp, angles.psp, endpoints.psp, extrapolate.psp.

Examples

Run this code
  a <- psp(runif(10), runif(10), runif(10), runif(10), window=owin())
  b <- lengths_psp(a)   

Run the code above in your browser using DataLab