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

clickjoin

Interactively join vertices on a plot


Description

Given a point pattern representing a set of vertices, this command gives a point-and-click interface allowing the user to join pairs of selected vertices by edges.

Usage

clickjoin(X, ..., add = TRUE, m = NULL, join = TRUE)

Arguments

X

Point pattern of vertices. An object of class "ppp".

...

Arguments passed to segments to control the plotting of the new edges.

add

Logical. Whether the point pattern X should be added to the existing plot (add=TRUE) or a new plot should be created (add=FALSE).

m

Optional. Logical matrix specifying an initial set of edges. There is an edge between vertices i and j if m[i,j] = TRUE.

join

Optional. If TRUE, then each user click will join a pair of vertices. If FALSE, then each user click will delete an existing edge. This is only relevant if m is supplied.

Details

This function makes it easier for the user to create a linear network or a planar graph, given a set of vertices.

The function first displays the point pattern X, then repeatedly prompts the user to click on a pair of points in X. Each selected pair of points will be joined by an edge. The function returns a logical matrix which has entries equal to TRUE for each pair of vertices joined by an edge.

The selection of points is performed using identify.ppp which typically expects the user to click the left mouse button. This point-and-click interaction continues until the user terminates it, by pressing the middle mouse button, or pressing the right mouse button and selecting stop.

The return value can be used in linnet to create a linear network.

Value

Logical matrix m with value m[i,j] = TRUE for every pair of vertices X[i] and X[j] that should be joined by an edge.

Author(s)

See Also


spatstat.linnet

Linear Networks Functionality of the 'spatstat' Family

v2.1-1
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Ottmar Cronie [ctb], Tilman Davies [ctb], Greg McSwiggan [ctb], Suman Rakshit [ctb]
Initial release
2021-03-28

We don't support your browser anymore

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