S1mple
S1mple

Reputation: 43

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

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

Answers (1)

Xyp9x
Xyp9x

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

Related Questions