Hi ikuzar, Try
subset(df, myvalue == 1800, select = Date)[1, ] See ?subset for more information. HTH, Jorge.- On Thu, Jan 19, 2012 at 6:42 PM, ikuzar <> wrote: > Hi, > I 'd like to select the Date where myvalue =1800 appears the* first time*. > > For instance: > df =data.frame(date, myvalue, ...) > > ... > > Date myvalue > 2012-01-05 2500 > 2012-01-06 2450 > *2012-01-07 1800* > 2012-01-08 2200 > 2012-01-09 1800 > > I'd like to retrieve the third line. > > I do not find a clean way. > > Thanks for your help > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/dataframe-how-to-select-an-element-from-a-row-tp4311881p4311881.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.