0

I have a data for which I need to create a frequency bar plot.The data contains 2 fields . One is timestamp and other some data. I need to use this timestamp and find if this is in one range of time then add one to it. Otherwise add it to another. I am not able to understand how to do without using loops.

sample data

thread_count           timestamp
            1 2014-01-27 16:33:39
            2 2014-01-27 16:34:50
            3 2014-01-27 16:35:19
            2 2014-01-27 16:36:32
            1 2014-01-27 16:37:11
            1 2014-01-27 16:39:00 

Now i want to aggregate with time range 16:34 - 16:36 and 16:37 : 16:40. how to do this

  • 3
    Please provide a reproducible example and show us what you've tried and why it doesn't work. A few tips on how to do that are here: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Roman Luštrik Jan 27 '14 at 10:10
  • i am trying to use loops to iterate through each example and converting timestamps into minutes to identify in which range the timestamp lies. i am not able to understand which function to use – Satyam Krishna Jan 27 '14 at 10:17
  • @RomanLuštrik i have added the sample data. so basically i need to find the total no of threads in a given range and draw the bar plot. I am able to do this with the help of loop. what will be the efficient way of doing this – Satyam Krishna Jan 27 '14 at 11:11
  • 1
    Have you checked the link I provided? It will give you ideas of how to convey your example to others so that they can reproduce your problem with minimal effort (for instance using `dput()` function). At this point it would also help if you could show what the desired output would be. – Roman Luštrik Jan 27 '14 at 12:21

0 Answers0