我把这个问题作为一个可重复的例子。这是我的数据框的一部分:
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"))
我想创建一个直方图,轴上的时间范围x
从17:30
到07:30
(分钟),并在轴上计数。我曾尝试使用库和 with转换时间,但似乎不喜欢这两种方法。任何帮助深表感谢。binwidth
30
y
chron
posixct
ggplot