identifyPoint {iSPlot}R Documentation

Identify the point clicked on a scatterplot


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


identifyPoint(curplot, xyloc)


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


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


Elizabeth Whalen

See Also

checkPoint, sPlotView-class


  if (interactive())
    # should load data through Open Data or Open File under the File menu
    # 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
    # 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.3 Index]