[R] Aggregate rows to see the number of occurences

Nicolas STRANSKY Nicolas.Stransky at curie.fr
Mon Jun 7 12:18:19 CEST 2004


Hi,

I have a set of data like the following:
       [,1]  [,2]
[1,]   10    2
[2,]    7    0
[3,]    1    0
[4,]    1    0
[5,]   15    0
[6,]   17    4
[7,]    4    0
[8,]   19    8
[9,]   10    2
[10,]  19    5

I'd like to aggregate it in order to obtain the frequency (the number of 
occurences) for each couple of values (e.g.: (10,2) appears twice, (7,0) 
appears once). Something cool would be to have this value in a third 
column...
I've been looking at aggregate() but either I couldn't get the right 
parameters, or this is not the right tool to use...

Thank's for any help !

-- 
Nicolas STRANSKY
Équipe Oncologie Moléculaire
Institut Curie - UMR 144 - CNRS                 Tel : +33 1 42 34 63 40
26, rue d'Ulm - 75248 Paris Cedex 5 - FRANCE    Fax : +33 1 42 34 63 49




More information about the R-help mailing list