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

clicklpp

Interactively Add Points on a Linear Network


Description

Allows the user to create a point pattern on a linear network by point-and-click in the display.

Usage

clicklpp(L, n=NULL, types=NULL, ...,
           add=FALSE, main=NULL, hook=NULL)

Arguments

L

Linear network on which the points will be placed. An object of class "linnet".

n

Number of points to be added (if this is predetermined).

types

Vector of types, when creating a multitype point pattern.

...

Optional extra arguments to be passed to locator to control the display.

add

Logical value indicating whether to create a new plot (add=FALSE) or draw over the existing plot (add=TRUE).

main

Main heading for plot.

hook

For internal use only. Do not use this argument.

Details

This function allows the user to create a point pattern on a linear network by interactively clicking on the screen display.

First the linear network L is plotted on the current screen device. Then the user is prompted to point the mouse at any desired locations and click the left mouse button to add each point. Interactive input stops after n clicks (if n was given) or when the middle mouse button is pressed.

The return value is a point pattern on the network L, containing the locations of all the clicked points, after they have been projected onto the network L. Any points that were clicked outside the bounding window of the network will be ignored.

If the argument types is given, then a multitype point pattern will be created. The user is prompted to input the locations of points of type type[i], for each successive index i. (If the argument n was given, there will be n points of each type.) The return value is a multitype point pattern on a linear network.

This function uses the R command locator to input the mouse clicks. It only works on screen devices such as ‘X11’, ‘windows’ and ‘quartz’. Arguments that can be passed to locator through ... include pch (plotting character), cex (character expansion factor) and col (colour). See locator and par.

Value

A point pattern (object of class "lpp").

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk, based on an idea by Dominic Schuhmacher.

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.