[R] Extracting last time value

From: Kondamani, Arjun \(GMI - NY Corporate Bonds\) <arjun_kondamani_at_ml.com>
Date: Thu, 10 Jan 2008 17:36:45 -0500


I have a dataframe as follows:

Date		time		value
20110620	11:18:00	7
20110620	11:39:00	9
20110621	11:41:00	8
20110621	11:40:00	6
20110622	14:05:00	8
20110622	14:06:00	6

For every date, I want to extract the row that has the greatest time. Therefore, ending up like:

20110620	11:39:00	9
20110621	11:41:00	8
20110622	14:07:00	6

I am using for loops (for every date, find largest time value) to do this determination, but I am sure there is a simpler way in "R". Has anyone run into this before?


This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing.


        [[alternative HTML version deleted]]



R-help_at_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. Received on Thu 10 Jan 2008 - 22:42:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 Jan 2008 - 01:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive