I'm trying to fill the time-sequence based on start and end of time. Here is the dataset.
structure(list(type = structure(c(3L, 2L, 3L, 2L, 3L, 2L, 1L), .Label = c("", "end_time", "start_time"), class = "factor"), col1 = structure(c(2L, 3L, 3L, 4L, 4L, 5L, 1L), .Label = c("", "2019-07-07 21:53:00", "2019-07-07 21:53:40", "2019-07-07 21:54:40", "2019-07-07 21:56:00" ), class = "factor"), value = structure(c(2L, 2L, 3L, 3L, 4L, 4L, 1L), .Label = c("", "VALUE_1", "VALUE_2", "VALUE_3"), class = "factor")), class = "data.frame", row.names = c(NA, -7L))
type col1 value
1 start_time 2019-07-07 21:53:00 VALUE_1
2 end_time 2019-07-07 21:53:40 VALUE_1
3 start_time 2019-07-07 21:53:40 VALUE_2
4 end_time 2019-07-07 21:54:40 VALUE_2
5 start_time 2019-07-07 21:54:40 VALUE_3
6 end_time 2019-07-07 21:56:00 VALUE_3
After setting an interval to fill the sequence, I want to make the filled sequence. For example, in case of 20-seconds, this is my expected table.
col1 value
2019-07-07 21:53:00 VALUE_1
2019-07-07 21:53:20 VALUE_1
2019-07-07 21:53:40 VALUE_1
2019-07-07 21:53:40 VALUE_2
2019-07-07 21:54:00 VALUE_2
2019-07-07 21:54:20 VALUE_2
2019-07-07 21:54:40 VALUE_2
2019-07-07 21:54:40 VALUE_3
2019-07-07 21:54:00 VALUE_3
2019-07-07 21:55:20 VALUE_3
2019-07-07 21:55:40 VALUE_3
2019-07-07 21:56:00 VALUE_3
How should I make the table using dplyr?