as.POSIX (PR#2222)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
28 Oct 2002 18:07:05 +0100


a.stephenson@lancaster.ac.uk writes:

> Full_Name: Alec Stephenson
> Version: 1.6.0
> OS: linux
> Submission from: (NULL) (148.88.138.5)
> 
> 
> Appears to be a sign error in as.POSIX(lt/ct)
> 
> > library("chron")
> 
> The following is fine, with default origin.
> 
> > tmp <- chron(1:2, origin = c(1,1,1970))
> > as.POSIXlt(tmp)
> [1] "1970-01-02 01:00:00 GMT" "1970-01-03 01:00:00 GMT"
> 
> These are not.
> 
> > tmp <- chron(1:2, origin = c(1,1,1960))
> > tmp
> [1] 01/02/60 01/03/60
> > as.POSIXlt(tmp)
> [1] "1980-01-03 GMT" "1980-01-04 GMT"
> 
> > tmp <- chron(1:2, origin = c(1,1,1990))
> > tmp
> [1] 01/02/90 01/03/90
> > as.POSIXlt(tmp)
> [1] "1950-01-02 GMT" "1950-01-03 GMT"

Right. as.POSIXct.dates subtracts where it should add. Fixed
for 1.6.1 (provided it checks out).

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._