Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

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.

Change of name

The name of this function has changed from lengths.psp to lengths_psp, because the old name lengths.psp could be misinterpreted as a method for lengths.

The older function name lengths.psp is retained temporarily, for consistency with older code and documentation.

In future versions of spatstat, the function name lengths.psp will be removed. The newer function name lengths_psp should be used.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

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

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.