I have made this question a reproducible example. Here is a portion of my data frame:
df <- structure(list(`Room Out Date` = c("2018-07-08", "2018-07-08",
"2018-07-08", "2018-07-09", "2018-07-09", "2018-07-09", "2018-07-09",
"2018-07-09", "2018-07-09", "2018-07-09", "2018-07-09", "2018-07-09",
"2018-07-10", "2018-07-10", "2018-07-10"),
`Room Out Time` = c("20:11:00",
"20:43:00", "22:28:00", "18:00:00", "18:32:00", "18:40:00", "18:59:00",
"19:16:00", "19:22:00", "19:38:00", "19:48:00", "21:24:00", "18:12:00",
"18:38:00", "18:40:00")), row.names = c(NA, -15L),
class = c("tbl_df", "tbl", "data.frame"))
I would like to create a histogram with times on the x
-axis ranging from 17:30
to 07:30
(with a binwidth
of 30
minutes) and count on the y
-axis. I have tried converting the times using the chron
library as well as with posixct
, but ggplot
doesn't seem to like either of those methods. Any help is much appreciated.