identifyPoint {iSPlot} | R Documentation

## Identify the point clicked on a scatterplot

### Description

identifyPoint determines which point on the scatterplot the user clicked. If no point was clicked, then identifyPoint returns NULL; otherwise, it returns the point (i.e. the row name).

### Usage

    identifyPoint(curplot, xyloc)

### Arguments

`curplot` | the active plot, which is of type sPlotView
`xyloc` | a list that contains the x and y location

### Value

If no point was clicked, then NULL is returned. Otherwise, if a point was clicked, then the following list items are returned.

`closestXY` | a list of the x and y position of the nearest point; note that this is not necessarily the same as the position the user clicked
`closestPoint` | the row name of the point clicked

### Author(s)

Elizabeth Whalen

### See Also

`checkPoint`, `sPlotView-class`

### Examples

      if (interactive())
      {
        createControlWindow()
        # should load data through Open Data or Open File under the File menu
        data(USArrests)
        loadDFData(USArrests,"USArrests")
        # plotting the data should occur through Plot Data under
        # the Display menu
        createView(type = "plotView", dataName = "USArrests",
                   plotType = "sPlotView", dfRows = 1:nrow(USArrests),
                   dfColumns = 1:2)
        # should set the view mode using the ViewMode menu
        setHighlightMode()
        # now click on a point on the plot, which will call the function
        # identifyPoint and if a point was clicked, then that point should be
        # highlighted
      }

[Package iSPlot version 1.0.7 Index]