[Rd] convert.times in chron,
error when 59 < seconds < 60 (PR#6878)
Kurt Hornik
Kurt.Hornik at wu-wien.ac.at
Wed May 19 13:09:13 CEST 2004
>>>>> wolfda writes:
> Full_Name: Dennis Wolf
> Version: 1.9.0
> OS: Mac OS 10.3.3
> Submission from: (NULL) (160.91.76.23)
> platform powerpc-apple-darwin6.8
> arch powerpc
> os darwin6.8
> system powerpc, darwin6.8
> status
> major 1
> minor 9.0
> year 2004
> month 04
> day 12
> language R
> Information on Package 'chron'
> Description:
> Package: chron
> Version: 2.2-29
> Date: 2004-01-31
> Author: S original by David James <dj at research.bell-labs.com>, R port
> by Kurt Hornik <Kurt.Hornik at R-project.org>.
> Maintainer: Kurt Hornik <Kurt.Hornik at R-project.org>
> Description: Chronological objects which can handle dates and times
> Title: Chronological objects which can handle dates and times
> Depends: R (>= 1.6.0)
> License: GPL
> Packaged: Sat Jan 31 13:31:05 2004; hornik
> Built: R 1.9.0; powerpc-apple-darwin6.8; 2004-04-15 01:23:51; unix
>> library(chron)
>> convert.times("20:27:58.6")
> [1] 0.8527616
>> convert.times("20:27:59.1")
> [1] NA
> Warning message:
> time-of-day entries out of range in positions 1 set to NA in:
> convert.times("20:27:59.1")
>>
> The fix appears to be to replace:
> i <- (hh[ok] < 0 | hh[ok] > 23 | mm[ok] < 0 | mm[ok] > 59 |
> ss[ok] < 0 | ss[ok] > 59)
> with:
> i <- (hh[ok] < 0 | hh[ok] > 23 | mm[ok] < 0 | mm[ok] > 59 |
> ss[ok] < 0 | ss[ok] >= 60)
> in code for convert.times
Thanks, fixed.
-k
More information about the R-devel
mailing list