This function is an S Version 3 generic (see Methods);
method functions can be written to handle specific
S Version 3 classes of data.
Classes which already have methods for this function include:
tree
,
xyplot
.
identify(x, ...) identify.default(x, y, labels=time(x), n=length(x), plot=T, atpen=T, offset=0.5, pts, tolerance=0.5, ...)
x
and
y
.
TRUE
,
identify
plots the labels of
the points identified. In any case, the subscripts are
returned.
TRUE
, plotted identification is
relative to locator position when the point is identified;
otherwise, plotting is relative to the identified
x,y
value.
This is useful for controlling the position of labels when points are
crowded.
offset
character widths from the point.
If the locator was left (right) of the nearest point,
the label will be offset to the left (right) of the point.
pts$x
and
pts$y
(or
pts[,1]
and
pts[,2]
if
pts
is a matrix) will be identified automatically, you will not need to
click on them.
x
and
y
) corresponding to identified points.
plot
is
TRUE
.
Observations that have missing values in either
x
or
y
are treated as if they were not given.
When using the
X11
driver under the X Window System, a point is identified
by positioning the cursor over the point and pressing the left button.
To exit
identify
press the middle button (both buttons on a two button
mouse) while the cursor is in the graphics window.
This function may also be used with the "tek" drivers.
Some devices that do not allow interaction prompt you for an x,y pair.
The nearest point to the locator position is identified.
In case of ties, the earliest point is identified.
We do not recommend the use of
locator
or
identify
to pause between pages when showing a series of graphs. Instead use
ask=T
in the plotting commands.
x <- rnorm(100) y <- rnorm(100) z <- sample(1:100, 100) plot(x, y) identify(x, y, z) # plot z values when x,y points identified bad <- identify(x, y, plot=FALSE) xgood <- x[-bad] # eliminate identified "bad" points ygood <- y[-bad] # from x and y # use the pts argument and locator to identify all points at once x <- c(1, 2, 3) y <- c(3, 4, 5) plot(x, y) pts <- locator() # click once on each of the three points identify(x, y, pts=pts) # all the points on the plot are labelled # at once