Reputation: 43
I have a list of time in 24hr format like:
times <- c(23.9, 0.5, 22.7, 0.1, 23.3, 1.2, 23.6)
I'm trying to find the mean of times... I can't seem to find a way and the mean()
function is giving wrong answer.
This is what I tried:
mean(times)
How can I get the correct mean of times?
Upvotes: 3
Views: 48
Reputation: 66
The clock has a circular scale, which ends where it begins, so you need to use circular statistics
install.packages("psych")
library(psych)
circadian.mean(bed.times) # This will give the correct mean
Upvotes: 3