locator2: Locator Function for Lattice

Description Usage Arguments Details Value

View source: R/locator2.R

Description

Reads the position of the graphics cursor from a lattice panel

Usage

1
locator2(n = 512, type = c("p", "v", "h", "both", "none"), ...)

Arguments

n

The maximum number of points to locate

type

One of "p", "v", "h", "both" or "none" to add a point, vertical line, horizontal line, both vertical and horizontal lines, or no mark at each selected point

...

Additional graphic parameters passed to either panel.points or panel.abline if type != "none"

Details

This provides a functional replacement for locator that works with lattice objects. A lattice panel will be selected, redrawn as a single panel and used to interact with the user. The position of the graphics cursor will be recorded with each click of the (first) mouse button.

By default, a point will be added at that position unless otherwise specified by the argument type.

Like the locator function, this function returns values in "usr" coordinates as a list.

Value

A list containing x and y coordinates of the identified points in the user coordinate system.


ornelles/flowExtra documentation built on March 1, 2020, 9:33 a.m.