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 6565527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:06:17+00:00 2026-05-25T14:06:17+00:00

I have a sorted list of descending dates. How do I get a probability

  • 0

I have a sorted list of descending dates. How do I get a probability history of the difference between the date on the current line and the date on the next line? I want to visualize the frequency of how often requests come in.

09/11/2011 13:46:39
09/11/2011 13:45:18
09/11/2011 13:44:58
09/11/2011 13:40:02
09/11/2011 13:37:58
09/11/2011 13:36:09
09/11/2011 13:32:31
09/11/2011 13:25:29
09/11/2011 13:24:40
09/11/2011 13:23:48

p.s. I’ve never used R before, so the more code the better. 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-25T14:06:19+00:00Added an answer on May 25, 2026 at 2:06 pm

    Read the data

    df <- read.table(textConnection("
    09/11/2011 13:46:39
    09/11/2011 13:45:18
    09/11/2011 13:44:58
    09/11/2011 13:40:02
    09/11/2011 13:37:58
    09/11/2011 13:36:09
    09/11/2011 13:32:31
    09/11/2011 13:25:29
    09/11/2011 13:24:40
    09/11/2011 13:23:48
    "), sep="\n")
    

    Convert to POSIXct date

    df$V1 <- as.POSIXct(df$V1, format="%d/%m/%Y %H:%M:%S")
    

    Load lattice and plot with the time differences with histogram.

    The function diff is very handy to calculate lagged differences. You will notice that I also use unclass this is because there is no histogram method for class difftime.

    library(lattice)
    
    histogram(unclass(-diff(df$V1)), xlab="Time difference")
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have sorted list of strings that I move between php and java. to
I have a list of articles sorted by descending rating. If the rating is
I have a PrivateMessage class and I want to get list of PMs for
I have a list of an object which need to be sorted depending on
I'm working in c#. I have a sorted List of structures. The structure has
I have a list of instances of the class 'Chromosome'. The list is sorted
I have a list of items sorted alphabetically: mylist = [a,b,c,d,e,f,g,h,i,j] I'm able to
I have a stl::list containing Widget class objects. They need to be sorted according
I have two lists of objects. Each list is already sorted by a property
def sortProfiles(p): return sorted(p, key=itemgetter('first_name')) I have a list with dictionaries. This function allows

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.