[R] Find duplicates and save their max value

Benilton Carvalho bcarvalh at jhsph.edu
Thu Oct 25 19:25:30 CEST 2007


?aggregate

b

On Oct 25, 2007, at 1:21 PM, Paul Christoph Schröder wrote:

> Hi,
>
> maybe someone can help me with this:
>
> I have a matrix of genes and values:
> GeneName   Value
> Abc1               10
> Abc2               11
> Bbc1                -5
> Bbc31               2
> Ccd                   5
> Ccd                  -2
> Ccd                   7
> Dda                   5
> Dda                  10
> .....                    .....
> Zzz3                  -1
>
> I would like to create a new matrix where the GeneNames which are
> duplicated and do not have the absolut maximum value between these
> duplicated genes, are deleted; i.e.
>
> GeneName   Value
> Abc1               10
> Abc2               11
> Bbc1                -5
> Bbc31               2
> Ccd                   7
> Dda                  10
> .....                    .....
> Zzz3                  -1
>
> Does anyone know if there is a function that works this way in R? How
> would you do it?
> Thank you very much in advance!
>
> Cheers
>
> Paul
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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