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

intensity.psp

Empirical Intensity of Line Segment Pattern


Description

Computes the average total length of segments per unit area in a spatial pattern of line segments.

Usage

## S3 method for class 'psp'
intensity(X, ..., weights=NULL)

Arguments

X

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

weights

Optional. Numeric vector of weights attached to the segments of X. Alternatively, an expression which can be evaluated to give a vector of weights.

...

Ignored.

Details

This is a method for the generic function intensity. It computes the empirical intensity of a line segment pattern (object of class "psp"), i.e. the average total segment length per unit area.

If the segment pattern is multitype, the intensities of the different types are computed separately.

Note that the intensity will be computed as the length per area in units per square unit, based on the unit of length for X, given by unitname(X). If the unit of length is a strange multiple of a standard unit, like 5.7 metres, then it can be converted to the standard unit using rescale. See the Examples.

If weights are given, then the intensity is computed as the total weight times length per square unit. The argument weights should be a numeric vector of weights for each point of X (weights may be negative or zero).

Alternatively weights can be an expression which will be evaluated for the dataset to yield a vector of weights. The expression may involve the Cartesian coordinates x,y of the points, and the marks of the points, if any. Variable names permitted in the expression include x0, x1, y0, y1 for the coordinates of the segment endpoint, the name marks if X has a single column of marks, the names of any columns of marks if X has a data frame of marks, and the names of constants or functions that exist in the global environment. See the Examples.

Value

A numeric value (giving the intensity) or numeric vector (giving the intensity for each possible type).

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

S <- edges(letterR)
  intensity(S)
  intensity(S, weights=runif(nsegments(S)))
  intensity(S, weights=expression((x0+x1)/2))

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.