如何找到 24 小时格式时间列表的平均时间?

How to find mean time of list of 24hr format time?

我有一个 24 小时格式的时间列表,例如:

times <- c(23.9, 0.5, 22.7, 0.1, 23.3, 1.2, 23.6)

我正在尝试找到时间的平均值...我似乎找不到方法,而且 mean() 函数给出了错误的答案。

这是我试过的:

mean(times)

如何获得正确的时间平均值?

时钟有一个圆形刻度,从开始到结束,所以你需要使用循环统计

install.packages("psych")
library(psych)
circadian.mean(bed.times) # This will give the correct mean