I have a data frame which looks like this:
"22:36:59", "22:37:00", "22:37:01", "22:37:02", "22:37:03",
"23:47:39", "23:47:40", "23:47:41", "23:47:42", "23:47:43",
"23:47:44", "23:47:45", "23:47:46", "23:47:47", "23:47:48",
"23:59:49", "23:59:50", "23:59:51", "23:59:52", "23:59:53",
"23:59:54", "23:59:55", "23:59:56", "23:59:57", "23:59:58",
"23:59:59"), class = "factor"), V5 = structure(c(1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "CEST", class = "factor"),
V6 = c(2019L, 2019L, 2019L, 2019L, 2019L, 2019L, 2019L, 2019L,
2019L, 2019L)), row.names = c(NA, 10L), class = "data.frame")
I want to change the hours in column V4 by subtracting 07:00:00. If the hours in column V4 is smaller than 07:00:00 then it should as well change the day in column V3 and in case the day goes to the month before then it should change the month in column V2. The final aim of this is to count how many rows are there for each day, for which I can use:
count(entertainment_one, c("V2", "V3"))
but before I need to reorganise my data frame.
I am new to R and do not know where to start. Any help would be really appreciated, thank you very much!
↧
Subtracting value in a column and change another one
↧