Skip to content
Prev 165985 / 398502 Next

the first and last observation for each subject

plyr does make some optimisations to increase speed and decrease
memory usage (mainly by passing around lists of indices, rather than
lists of the original objects) but it's unlikely ever to approach the
speed of a pure vector approach (although I hope to put some time into
rewriting the slow parts in C to do better with performance).
I particularly this solution to the problem - it's a very handy
technique, and while it takes a while to get your head around how it
works, it's worthwhile spending the time to do so because it crops up
as a useful solution to many similar types of problems. (It can be
particularly useful in excel too, as a quick way of locating
boundaries between groups)

Hadley