Solved my own question by looking at some other threads. For those who may be intersted, here was the solution to my problem.
do.call(rbind,lapply(split(data.frame,FISH_ID),function(x)x[which.max(x$DATE_TIME),])) -- View this message in context: http://n4.nabble.com/How-can-I-return-rows-from-a-data-frame-with-maximum-value-by-factor-tp1596777p1596853.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.