[R] Finding an average time spent

Gabor Grothendieck ggrothendieck at gmail.com
Sat Aug 13 09:36:07 CEST 2011


On Fri, Aug 12, 2011 at 4:23 PM, erinbspace <erin.braswell at gmail.com> wrote:
> Hello R help!
>
> I am extremely new to R (as in 3 just days) and I've been using it to do
> some pretty basic things. I am frustratingly stuck on one point, and am so
> so so close to figuring it out, but just far enough away to ask for some
> (perhaps embarrassingly easy) help.
>
> I have a dataset, visitors, that has a variable called Time.Spent.
> Time.Spent consists of times in the format hh:mm:ss , and it is a
> measurement, kind of like a timer, of the amount of time someone spent in a
> museum exhibit.
>
> I need to find the average time spent.  I've figured the easiest way to do

> library(chron)
> Time.Spent <- c("12:12:10", "13:12:10")
> times(mean(as.numeric(times(Time.Spent))))
[1] 12:42:10

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list