From Kurt.Hornik at wu-wien.ac.at  Wed Feb  8 11:27:19 2006
From: Kurt.Hornik at wu-wien.ac.at (Kurt Hornik)
Date: Wed, 8 Feb 2006 11:27:19 +0100
Subject: [Rd] chron library: format.times, parse.format and h:m (PR#8507)
In-Reply-To: <20060119202902.9382428FB5@slim.kubism.ku.dk>
References: <20060119202902.9382428FB5@slim.kubism.ku.dk>
Message-ID: <17385.51079.962784.151654@mithrandir.hornik.net>

>>>>> spector  writes:

> Due to the following lines in parse.format:
> else if (nf == 3) {
>         sep <- ""
>         fmt <- substring(format, first = 1:3, last = 1:3)
>     }

> If a format code has 3 characters, it will not use a separator:

>> library(chron)
>> mytime = times('7:15:00')
>> format(mytime,'h:m')
> [1] "0715"
>                                        - Phil Spector
> 					 Statistical Computing Facility
> 					 Department of Statistics
> 					 UC Berkeley
> 					 spector at stat.berkeley.edu

The docs say

          The times format can be any permutation of '"h"', '"m"', and
          '"s"' separated by any one non-special character.  The
          default is '"h:m:s"'.

and I would read *permutation* as to include each of h m s, so that
incomplete representations like the one you gave are ruled out.

(In any case, it seems we should teach the docs about the no-separator
case.)

-k



[Rd] chron library: format.times, parse.format and h:m (PR#8507)
Kurt Hornik