I am trying to identify the average time in a column of a data frame in hr:min:sec format using R. But no luck. Help is much appreciated. Data sample is as below:
One way with lubridate package. We convert the time into seconds, take the mean of it and then convert those seconds to time again.
lubridate
Col_Time = c('03:08:20','03:11:30','03:22:18','03:27:39') library(lubridate) seconds_to_period(mean(period_to_seconds(hms(Col_Time)))) #[1] "3H 17M 26.75S"