Hi, data.frame(GeneName=unique(df$GeneName),Value=sapply(unique(df$GeneName), function(x)max(df$Value[df$GeneName==x])))
On 25/10/2007, Paul Christoph Schröder <[EMAIL PROTECTED]> 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@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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ R-help@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.