[R] 2 questions : format and hh:mm
Gabor Grothendieck
ggrothendieck at myway.com
Thu Jul 29 15:29:23 CEST 2004
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)
More information about the R-help
mailing list