[datatable-help] Subsetting By Row Function

bgoldstein ben.goldstein at gmail.com
Sat Jul 19 00:40:33 CEST 2014


I am having trouble defining (and therefore searching) for this problem. I
have data like this:

Group Value Date
1         xxx   June
1         yyy   July
2         zzzz   May
2         qqqq  August
etc.


I want to subset the 'Value' of each 'Group' by the latest 'Date'. So my
output should be:

Group Value Date
1         yyy   July
2         qqqq  August
etc.

The doBy package has a firstobs() function that works but is quite slow.

What would be a data.table way to do this?

Thank you,

Ben



--
View this message in context: http://r.789695.n4.nabble.com/Subsetting-By-Row-Function-tp4694221.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list