This function allows its user to define events with mouse clicks on
the current plot via the locator function. The
arguments n and type are the usual parameters of the
locator function. If EID is not missing, then
n = length(EID).
On exit from locator, suppose the user defined m
events. If EID was missing, then the output data frame will
contain m events. However, if EID exists, then the
output data frame will contain length(EID) events, and both
X and Y will be NA for events
EID[(m+1):n]. The na.omit function
can remove rows with NAs.