Interacting with a scatterplot: the Identify function
The < identify > function enables to click on a scatterplot and thus identify its points interactively.
# let's generate the x and y vectors x.nv <- c (1, 2, 3, 4, 2, 3) y.nv <- c (4, 2, 1, 4, 1, 5) # let's plot them plot (x = x.nv, y = y.nv, xlab = "x", ylab = "y") # let's use identify identify (x = x.nv, y = y.nv) # output: the point closest to the mouse click coordinates