Skip to content

Calculate Averages for time data

3 messages · Sunita22, Gabor Grothendieck, Sunita Patil

#
Hello

I have time data which is in hh:mm:ss format and I need to calculate
averages for this data. I tried converting the data as integer so that I
could calculate the average, but it doesn't serve the purpose. I tried using
Chron package also. But I am stuck up as to how to deal with the time data.
Please guide me as to how to deal with Time data in R.

Thank you in advance

Regards
Sunita
#
Next time please provide sample input.

library(chron)

# input
ch <- c("02:24:00", "04:48:00", "07:12:00", "09:36:00", "12:00:00",
"14:24:00", "16:48:00", "19:12:00", "21:36:00")

# convert to times
tt <- times(ch)

# calculate mean
mean(tt)
On Tue, Nov 3, 2009 at 10:35 AM, Sunita22 <sunitap22 at gmail.com> wrote: