[R] extracting the last row of each group in a data frame

Hao Cen hcen at andrew.cmu.edu
Mon Nov 16 20:42:37 CET 2009


Hi,

I would like to extract the last row of each group in a data frame.

The data frame is as follows

Name Value
A 1
A 2
A 3
B 4
B 8
C 2
D 3

I would like to get a data frame as
Name Value
A 3
B 8
C 2
D 3

Thank you for your suggestions in advance

Jeff




More information about the R-help mailing list