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

psp.object

Class of Line Segment Patterns


Description

A class "psp" to represent a spatial pattern of line segments in the plane. Includes information about the window in which the pattern was observed. Optionally includes marks.

Details

An object of this class represents a two-dimensional pattern of line segments. It specifies

  • the locations of the line segments (both endpoints)

  • the window in which the pattern was observed

  • optionally, a “mark” attached to each line segment (extra information such as a type label).

If X is an object of type psp, it contains the following elements:

ends data frame with entries x0, y0, x1, y1
giving coordinates of segment endpoints
window window of observation
(an object of class owin)
n number of line segments
marks optional vector or data frame of marks
markformat character string specifying the format of the
marks; “none”, “vector”, or “dataframe”

Users are strongly advised not to manipulate these entries directly.

Objects of class "psp" may be created by the function psp and converted from other types of data by the function as.psp. Note that you must always specify the window of observation; there is intentionally no default action of “guessing” the window dimensions from the line segments alone.

Subsets of a line segment pattern may be obtained by the functions [.psp and clip.psp.

Line segment pattern objects can be plotted just by typing plot(X) which invokes the plot method for line segment pattern objects, plot.psp. See plot.psp for further information.

There are also methods for summary and print for line segment patterns. Use summary(X) to see a useful description of the data.

Utilities for line segment patterns include midpoints.psp (to compute the midpoints of each segment), lengths_psp, (to compute the length of each segment), angles.psp, (to compute the angle of orientation of each segment), and distmap.psp to compute the distance map of a line segment pattern.

Author(s)

and Rolf Turner r.turner@auckland.ac.nz

See Also

Examples

# creating 
    a <- psp(runif(20),runif(20),runif(20),runif(20), window=owin())
# converting from other formats
    a <- as.psp(matrix(runif(80), ncol=4), window=owin())
    a <- as.psp(data.frame(x0=runif(20), y0=runif(20),
                            x1=runif(20), y1=runif(20)), window=owin())
# clipping
    w <- owin(c(0.1,0.7), c(0.2, 0.8))
    b <- clip.psp(a, w)
    b <- a[w]
# the last two lines are equivalent.

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.