У меня есть фрейм данных, когда идентификатор проверяется, он может быть либо пропущен, либо не выполнен в этот конкретный момент.Как рассчитать, сумма времени, затраченного на изменение статуса с Сбой на Пройденное состояние с идентификаторами.Если идентификатор не удался, сбой, состояние прошло.Я должен добавить время, необходимое для изменения статуса с первого не пройденного и второго не пройденного состояния
time <- c("08-10-2018 08:36", "12-10-2018 07:53", "23-10-2018 23:09", "30-10-2018 18:24","07-11-2018 18:13","10-11-2018 05:47","19-11-2018 21:26","26-11-2018 14:04","16-10-2018 03:19","07-11-2018 19:00","09-11-2018 23:25","20-11-2018 19:24", "22-11-2018 01:12","28-11-2018 03:46","04-10-2018 15:05","15-10-2018 15:32","20-10-2018 06:21","26-10-2018 04:51","02-11-2018 00:28","09-11-2018 22:43","15-11-2018 22:39","21-11-2018 04:10","26-11-2018 13:29")
id <-c("A1","A1","A1","A1","A1","A1","A1","A1","A2","A2","A2","A2","A2","A2","A3","A3","A3","A3","A3","A3","A3","A3","A3")
status <- c("FAILED","PASSED","FAILED","PASSED","FAILED","PASSED","PASSED","PASSED","PASSED","FAILED","PASSED","FAILED","PASSED","PASSED","PASSED","FAILED","PASSED","PASSED","PASSED","FAILED","PASSED","PASSED","FAILED")
df <- data.frame(id, time, status)
Обязательный формат:
ids <- c("A1","A2", "A3")
diff_time <- c(13.25, 3.46, 10.61)
df2 <- data.frame(ids,diff_time)
Заранее спасибо