Please note that in the answer @FJCC gave you for your previous problem, they created dummy data so it was in the form of a reprex, which makes it much easier for others to help you:
I'll point you to the relevant part of the code, which uses the hour()
function from lubridate, and then, given that lubridate has a comparable minute()
function, try adapting it from there:
library(lubridate)
HourColleague <- TimeSheet %>% mutate(ID = 1:nrow(TimeSheet),
HourStart = hour(ceiling_date(Start.Time, unit = "hour")),
HourEnd = hour(floor_date(Actual.End.Time - 60, unit = "hour"))) %>%
filter(HourStart <= HourEnd) %>%
group_by(ID) %>%
mutate(HourSeq = list(tidyr::full_seq(c(HourStart, HourEnd), 1))) %>%
tidyr::unnest(cols = HourSeq) %>%
mutate(DateTime_bin = make_datetime(year = year(Start.Time),
month = month(Start.Time),
day = day(Start.Time),
hour = HourSeq)) %>%
ungroup()