identify.formula {NCStats}R Documentation

Identify points in a plot using a formula.

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

## 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

## 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)


[Package NCStats version 0.4.7 Index]