I have a dataframe in which one column contains different dates including times, e.g.
as.POSIXct(c("2017-07-03 08:23:00",
"2017-07-03 09:00:00",
"2017-07-03 17:23:00",
"2017-07-03 18:05:00",
"2017-07-04 08:24:00",
"2017-07-04 09:02:00",
"2017-07-04 17:24:00",
"2017-07-04 18:01:00",
"2017-07-05 08:57:00",
"2017-07-05 09:31:00",
"2017-07-05 16:25:00",
"2017-07-05 17:14:00"))
Now I want to look at how many times a certain time occurs at intervals (say 15 min). Thus, I aim to get a histogram of frequency (over all days) vs time of day.
Any hints?
Edit: I tried to extract the time by
df$Time <- hm(format(df$Date, "%H:%M"))
but this left me with a column of class period that I didn't know how to handle. I also tried something like
ggplot(df, aes(Date)) +
geom_histogram() +
scale_x_time()
My main problem here is how can I use ggplot to do the plotting.