[R] Calculate Averages for time data

2009-11-03 Thread Sunita22

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
-- 
View this message in context: 
http://old.nabble.com/Calculate-Averages-for-time-data-tp26160202p26160202.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Calculate Averages for time data

2009-11-03 Thread Gabor Grothendieck
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 sunita...@gmail.com wrote:

 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
 --
 View this message in context: 
 http://old.nabble.com/Calculate-Averages-for-time-data-tp26160202p26160202.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Calculate Averages for time data

2009-11-03 Thread Sunita Patil
Thank you so much it did solve my purpose.

Regards

Our Thoughts have the Power to Change our Destiny.
Sunita


On Tue, Nov 3, 2009 at 9:15 PM, Gabor Grothendieck
ggrothendi...@gmail.comwrote:

 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 sunita...@gmail.com wrote:
 
  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
  --
  View this message in context:
 http://old.nabble.com/Calculate-Averages-for-time-data-tp26160202p26160202.html
  Sent from the R help mailing list archive at Nabble.com.
 
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.