Dear All, I have a data frame with the columns "Mass" and "Intensity" (this is mass spectrometry stuff). Each of the mass values gives rise to a mass window of 5 ppm around the individual mass (from mass - mass/1E6*5 to mass + mass/1E5*5). I need to filter the array such that in case these mass windows overlap I retain the mass/intensity pair with the highest intensity. I apologize for this question, but I have no formal IT education and would value any nudges toward favorable algorithmic solutions highly. Thanks for any help, Joh
Sorry, this sounds like a fairly basic question that can be resolved by which() and possible ifelse(). There is no details in your email. I am afraid you have to learn the basics of R or ask question with more details (e.g. example data). Or ask someone locally. Regards, Adai Johannes Graumann wrote:> Dear All, > > I have a data frame with the columns "Mass" and "Intensity" (this is mass > spectrometry stuff). Each of the mass values gives rise to a mass window of > 5 ppm around the individual mass (from mass - mass/1E6*5 to mass + > mass/1E5*5). I need to filter the array such that in case these mass > windows overlap I retain the mass/intensity pair with the highest > intensity. > I apologize for this question, but I have no formal IT education and would > value any nudges toward favorable algorithmic solutions highly. > > Thanks for any help, > > Joh > > ______________________________________________ > 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. > > >
I think we need a bit more information and perhaps a small example data set to see what you want. I am not familiar with term mass window. Is this a confidence interval around the mass value? --- Johannes Graumann <johannes_graumann at web.de> wrote:> Dear All, > > I have a data frame with the columns "Mass" and > "Intensity" (this is mass > spectrometry stuff). Each of the mass values gives > rise to a mass window of > 5 ppm around the individual mass (from mass - > mass/1E6*5 to mass + > mass/1E5*5). I need to filter the array such that in > case these mass > windows overlap I retain the mass/intensity pair > with the highest > intensity. > I apologize for this question, but I have no formal > IT education and would > value any nudges toward favorable algorithmic > solutions highly. > > Thanks for any help, > > Joh > > ______________________________________________ > 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. >