David Winsemius wrote: > > > You seen to be under the mistaken impression that the internal > representation of DateTime classes of 08:00 would be 80000. Since the > internal representation of time is in seconds, the even number hours > would be at integer multiples of 60*60. In addition the conversion of > numeric to string in this situation may present some need to check for > missing leading "0"'s. You ether need to describe the data situation > more completely or adjust your expectations (or both). > > ?as.POSIXct > ?strptime > > -- > David. > >
Thanks for the quick reply David. What I need is a simple conversion that can say 80000=08:00, 94500=09:45 and 100000=10:00 and so on. I agree with you that the extra leading "0s" would need an extra check. The data situation is the following: I have several thousands of observations each day and I want to average them out throughout bins of a specified size (either 15 or 5 minutes). An example of the data follows, where the first column is the time and the second represents seconds between different events. example.txt 070002,1 070002,0 070002,0 070003,1 070003,0 070003,0 070003,0 070003,0 ... 100210,0 100210,0 100210,0 100210,0 100210,0 100210,0 100210,0 ... -- View this message in context: http://r.789695.n4.nabble.com/Chron-object-in-time-series-plot-tp3002285p3002358.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.