[R] Identifying points in a plot that have duplicate values

José Rafael Ferrer Paris jr_frrr at yahoo.de
Tue Mar 6 14:28:56 CET 2007


A very simple solution is given in:

help(sunflowerplot,package="graphics")

##If you want to see it in action:
example(sunflowerplot)

El mar, 06-03-2007 a las 19:55 +1100, Jim Lemon escribió:
> David Lloyd wrote:
> > I have code like this: - 
> > 
> > #-----------------------------------------------------------------------
> > ------------------------------------------------------
> > 
> > x=scan()
> > 0 0 0 0 0 1 2 3 4
> > 
> > y=scan()
> > 1 1 1 2 2 1 3 4 5
> > 
> > plot(x,y)
> > 
> > identify(0,1,3) #Allows me to select manually to identify co-ordinate
> > (0,1) as being duplicated 3 times
> > identify(0,2,2) #Allows me to select manually to identify co-ordinate
> > (0,2) as being duplicated 2 times
> > #-----------------------------------------------------------------------
> > ------------------------------------------------------
> > 
> > Is there not a way I can automatically display if points are duplicated
> > and by how many times?
> > 
> > I thought if I 'jittered' the points ever so slightly I could get an
> > idea of how many duplicates there are but with >100 points the graph
> > looks very messy.
> > 
> Hi David.
> In the plotrix package there are a few functions that might be helpful.
> 
> cluster.overplot - moves ovelying points into a small cluster up to 9
> count.overplot - displays the number of overlying points
> sizeplot - displays symbols with size relative to the number of points
> 
> Jim

-- 
Dipl.-Biol. JR Ferrer Paris
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Laboratorio de Biología de Organismos --- Centro de Ecología
Instituto Venezolano de Investigaciones Científicas (IVIC) 
Apdo. 21827, Caracas 1020-A 
República Bolivariana de Venezuela

Tel: (+58-212) 504-1452
Fax: (+58-212) 504-1088

email: jferrer at ivic.ve
clave-gpg: 2C260A95



More information about the R-help mailing list