average time in a column in hr:min:sec format

前端 未结 3 569
悲&欢浪女
悲&欢浪女 2021-01-21 04:27

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:



        
3条回答
  •  死守一世寂寞
    2021-01-21 04:50

    We can do this without using any external packages

    format(mean(strptime(Col_Time, "%H:%M:%S")), "%H:%M:%S")
    #[1] "03:17:26"
    

    data

    Col_Time = c('03:08:20','03:11:30','03:22:18','03:27:39')
    

提交回复
热议问题