identify.formula: Identify points in a plot using a formula.

Description Usage Arguments Details Value See Also Examples

View source: R/misc-utils.R

Description

Reads the position of the graphics pointer when the (first) mouse button is pressed, searches the coordinates given in x and y for the point closest to the pointer, and return the index if this point is close enough to the pointer.

Usage

1
2
## S3 method for class 'formula'
identify(x, data = NULL, ...)

Arguments

x

A formula of the form y~x.

data

The data frame from which the formula should be evaluated.

...

Other arguments to be passed to identify.

Details

This function is meant to make it easier to call identify after plot has been called using a formula and the data= argument.

A two dimensional plot must be active and the vectors in x and data frame in data must correspond to the x- and y-axes and the data of the plot.

Value

See identify

See Also

identify

Examples

1
2
3
4
5
6
7
## Not run by examples().  Copy and try in an interactive R session
## Not run: 
df <- data.frame(x=runif(10),y=runif(10),grp=factor(rep(c("Yes","No"),each=5)))
plot(y~x,data=df)
identify(y~x,data=df)

## End(Not run)

droglenc/NCStats documentation built on June 5, 2021, 2:06 p.m.