[R] plots - scatterplots - find index of a point in a list

John Kane jrkrideau at yahoo.ca
Tue May 8 16:12:08 CEST 2007


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



More information about the R-help mailing list