With the help of Andrie on StackOverflow.com, I was able to learn about ddply. I have another question that is more trivial and cannot seem to find help on IRC and do not want to bother Andrie again. I can't seem to figure out what to google for, so I thought I'd ask here.
I have: library(plyr) df_diff <- ddply(df, .(SOURCE), summarize, TIME_DIFF=-unclass(diff(REQUEST_DATE))) df_diff SOURCE TIME_DIFF 1 A 7.55 2 A 5.55 3 A 3.40 4 D 35.00 5 D 563.00 6 D 37.00 7 D 35.00 8 D 996.00 ... with a lot more records. I want to essentially sort SOURCE asc, TIME_DIFF asc and output the top 15 lowest TIME_DIFFS for each SOURCE. How do I do this? Also, what is the data type of df_diff called so that I can look into it some more? [[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.