Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7605029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:03:48+00:00 2026-05-31T00:03:48+00:00

I’m a R beginner and having difficulty with the following pretty simple problem; I

  • 0

I’m a R beginner and having difficulty with the following pretty simple problem;
I have the following transaction data:

Data
Row#ID     Lable    Date          Time
4   15275   John    2000-05-16    16:15:00
7   15275   John    2000-05-16    16:25:00
22  15276   Bob     2000-07-04    18:05:00
25  15276   Bob     2000-08-07    05:23:00
10  1234    Kate    2000-06-17    18:07:00
13  1234    Kate    2000-06-21    06:49:00 

And need to generate a unique entry for each ID with the minimum Date and minimum Time,
Similar to this:

Row#    ID          Lable   Date        Time
        15275   John        2000-05-16  16:15:00
        15276   Bob         2000-07-04  18:05:00
        1234    Kate        2000-06-17  18:07:00

I have tried

unique<-aggregate(Date$Date ,list(Data$ID, Data$Time,unique_Data$Lable ), min)

to no avail.

Any assistance would be greatly appreciated.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:03:49+00:00Added an answer on May 31, 2026 at 12:03 am

    If the Data and Time columns are of class “character” or any other class for which there is a min method (but in particular not if either one is of class “factor) you could use this:

    mins <-aggregate(Data[ , c("Date", "Time")]  ,list(Data$ID) , min)
    mins
    

    Noting that there was a need to cover the class==”factor’ issue, this would have covered even that possibility;

    mins <-aggregate(Data[ , c("Date", "Time")]  ,list(Data$ID) , 
                                 function(x) min(as.character(x)) )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m a R beginner and having difficulty with the following pretty simple problem; I
I'm a beginner in JSF and I´m having the following problem: I have a
I'm having some trouble indexing data.frames in R. I'm an R beginner. I have
Being a beginner I am having difficulty to understand the following statement a)If in
I am having a small problem. I am a beginner to iPhone programming so
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later
I'm having a beginner problem: bool _isPalindrome(const string& str) { return _isPalindrome(str.begin(), str.end()); //
Having some really weird problem and as beginner with c++ I don't know why.
I'm having some trouble with the following. I'm a beginner, which is probably why.
I am a webservice beginner. Is it required to have two different projects having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.