Question

I know it seems stupid question to ask but I'm really struggling with this one:

I have a list of events with recorded StartDate values. How do I plot density of events by time? So I want to have a plot where on X axis will be time and on Y axis there will be number of event occured at this time period.

#   StartTime                  Wait time
162 2011-05-12 09:59:54        0:01:07
163 2011-05-12 10:00:24        0:05:57
164 2011-05-12 10:02:20        0:05:03
165 2011-05-12 10:03:49        0:33:35
166 2011-05-12 10:06:00        0:10:51

UPDATE: hist(dat$StartDate, breaks = "hours") works fine for me. However I need to make density line aroud this hist. I've no clue how to do that since I have NOT numeric values.

Was it helpful?

Solution

without example data I would guess something like

hist(dat$StartDate, breaks = "days")

EDIT

for your data maybe

hist(dat$StartTime, breaks = "mins")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top