Dear Jonas, Try this: with(fp, Frequenz[ which.max(AmpNorm) ] )
HTH, Jorge On Fri, May 8, 2009 at 8:49 AM, Jonas Stein <n...@jonasstein.de> wrote: > Hi, > > fp is a data frame like this > > ,----[ fp ] > | Frequenz AmpNorm > | 1 3322 0.0379490639 > | 2 3061 0.0476033058 > | 3 2833 0.0592954124 > | 4 2242 0.1275510204 > `---- > > i want to find the "Frequenz" where "AmpNorm" is max. > > I use this line as workaround: > PeakFreqHz = subset(fp, AmpNorm == max(AmpNorm))$Frequenz[1] > > Is there something nicer? > And is there an easy way to do the same on "predict()" > > Thank you and kind regards, > > -- > Jonas Stein <n...@jonasstein.de> > > ______________________________________________ > 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. > [[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.