[R] Calculating First Occurance by a factor

hadley wickham h.wickham at gmail.com
Wed Apr 1 18:00:46 CEST 2009


> I tried messing with the line df$FixTime[which.min(df$FixInx)] changing it
> to df[which.min(df$FixInx)] or adding new lines with the additional columns
> that I want to include, but nothing seemed to work. I'll admit I only have a
> mild understanding of what is going on with the function .fun. :-)

You probably want:

df[which.min(df$FixInx), ]

Hadley

-- 
http://had.co.nz/




More information about the R-help mailing list