Re: [R] 2 questions : format and hh:mm

From: Gabor Grothendieck <ggrothendieck_at_myway.com>
Date: Thu 29 Jul 2004 - 23:29:23 EST

Bruno Cutayar <bcutayar <at> lfdj.com> writes:

> 2- i search to generate a serie of hours and minutes on 24h :
> "00:00" , "00:01", "00:02", "00:03", ...,..., "23:59"

Using the chron package, if min is sequence of chron times, e.g.

   require(chron)
   m <- 24 * 60 # minutes in a day
   min <- times(seq(0,m-1)/m)

then you can format them as hh:mm:ss like this:

   format(min)

or as hh:mm like this:

   substring(min, 1, 5)



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jul 29 23:39:57 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:21 EST