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

identify.psp

Identify Segments in a Line Segment Pattern


Description

If a line segment pattern is plotted in the graphics window, this function will find the segment which is nearest to the mouse position, and print its serial number.

Usage

## S3 method for class 'psp'
identify(x, ..., labels=seq_len(nsegments(x)), n=nsegments(x), plot=TRUE)

Arguments

x

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

labels

Labels associated with the segments, to be plotted when the segments are identified. A character vector or numeric vector of length equal to the number of segments in x.

n

Maximum number of segments to be identified.

plot

Logical. Whether to plot the labels when a segment is identified.

...

Arguments passed to text.default controlling the plotting of the labels.

Details

This is a method for the generic function identify for line segment pattern objects.

The line segment pattern x should first be plotted using plot.psp. Then identify(x) reads the position of the graphics pointer each time the left mouse button is pressed. It then finds the segment in the pattern x that is closest to the mouse position. This segment's index will be returned as part of the value of the call.

Each time a segment is identified, text will be displayed next to the point, showing its serial number (or the relevant entry of labels).

Value

Vector containing the serial numbers of the segments in the pattern x that were identified.

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


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.