gatemaze at gmail.com
2007-May-08 13:38 UTC
[R] plots - scatterplots - find index of a point in a list
Hi, is it possible to find the index of a point of a plot (e.g. scatterplot) in an easy way? Eg. x <- c(1:5); y <- c(1:5); plot(x, y); On the plot if I move my cursor on top of a point or click on it is it possible to have its index printed or its exact value? Any clues? Thanks. [[alternative HTML version deleted]]
John Kane
2007-May-08 14:12 UTC
[R] plots - scatterplots - find index of a point in a list
Try ?locator --- gatemaze at gmail.com wrote:> Hi, > > is it possible to find the index of a point of a > plot (e.g. scatterplot) in > an easy way? > > Eg. > x <- c(1:5); y <- c(1:5); > plot(x, y); > > On the plot if I move my cursor on top of a point or > click on it is it > possible to have its index printed or its exact > value? Any clues? > > Thanks. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, > reproducible code. >