Hi all, I am using ISOdatetime, and I just found out that when I do ISOdatetime(1995,03,26,2,10,0) (or any other value under minutes or seconds) I get NA This does not happen with the same time in other dates, nor with different hours in the same date. Any hint why this happens? Using R 2.8.1 under ESS/GnuEmacs under Windows XP Pedro -- View this message in context: http://www.nabble.com/ISOdatetime-gives-NA-for-a-specific-date-tp21934989p21934989.html Sent from the R help mailing list archive at Nabble.com.
pbarros wrote:> Hi all, > > I am using ISOdatetime, and I just found out that when I do > ISOdatetime(1995,03,26,2,10,0) (or any other value under minutes or seconds) > I get NA > > This does not happen with the same time in other dates, nor with different > hours in the same date. > Any hint why this happens? > > Using R 2.8.1 under ESS/GnuEmacs under Windows XP > > PedroDaylight savings time, I guess. The clock went directly from 1:59 to 3:00 that day. Other systems behave strangely (er, "handle the anomaly") in different ways:> ISOdatetime(1995,03,26,1,10,0)[1] "1995-03-26 01:10:00 CET"> ISOdatetime(1995,03,26,2,10,0)[1] "1995-03-26 01:10:00 CET"> ISOdatetime(1995,03,26,3,10,0)[1] "1995-03-26 03:10:00 CEST" (SUSE 10.2) -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
On Tue, 10 Feb 2009, pbarros wrote:> > Hi all, > > I am using ISOdatetime, and I just found out that when I do > ISOdatetime(1995,03,26,2,10,0) (or any other value under minutes or seconds) > I get NA > > This does not happen with the same time in other dates, nor with different > hours in the same date. > Any hint why this happens?A non-existent time, most likely: x <- ISOdatetime(1995,03,26,1,10,0)> x[1] "1995-03-26 01:10:00 CET"> seq(x, length=10, by="hour")[1] "1995-03-26 01:10:00 CET" "1995-03-26 03:10:00 CEST" [3] "1995-03-26 04:10:00 CEST" "1995-03-26 05:10:00 CEST" [5] "1995-03-26 06:10:00 CEST" "1995-03-26 07:10:00 CEST" [7] "1995-03-26 08:10:00 CEST" "1995-03-26 09:10:00 CEST" [9] "1995-03-26 10:10:00 CEST" "1995-03-26 11:10:00 CEST" in TZ=Europe/Lisbon, which is my guess as to near where you are There was no 2:10 on 1995-03-26 in Lisbon: the clocks went forward an hour at 2 am.> Using R 2.8.1 under ESS/GnuEmacs under Windows XP > > Pedro-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Thanks. Now I know how to handle it. It was killing me.... Pedro Prof Brian Ripley wrote:> > On Tue, 10 Feb 2009, pbarros wrote: > >> >> Hi all, >> >> I am using ISOdatetime, and I just found out that when I do >> ISOdatetime(1995,03,26,2,10,0) (or any other value under minutes or >> seconds) >> I get NA >> >> This does not happen with the same time in other dates, nor with >> different >> hours in the same date. >> Any hint why this happens? > > A non-existent time, most likely: > > x <- ISOdatetime(1995,03,26,1,10,0) >> x > [1] "1995-03-26 01:10:00 CET" >> seq(x, length=10, by="hour") > [1] "1995-03-26 01:10:00 CET" "1995-03-26 03:10:00 CEST" > [3] "1995-03-26 04:10:00 CEST" "1995-03-26 05:10:00 CEST" > [5] "1995-03-26 06:10:00 CEST" "1995-03-26 07:10:00 CEST" > [7] "1995-03-26 08:10:00 CEST" "1995-03-26 09:10:00 CEST" > [9] "1995-03-26 10:10:00 CEST" "1995-03-26 11:10:00 CEST" > > in TZ=Europe/Lisbon, which is my guess as to near where you are > > There was no 2:10 on 1995-03-26 in Lisbon: the clocks went forward an > hour at 2 am. > >> Using R 2.8.1 under ESS/GnuEmacs under Windows XP >> >> Pedro > > > -- > Brian D. Ripley, ripley at stats.ox.ac.uk > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (PA) > Oxford OX1 3TG, UK Fax: +44 1865 272595 > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >-- View this message in context: http://www.nabble.com/ISOdatetime-gives-NA-for-a-specific-date-tp21934989p21936140.html Sent from the R help mailing list archive at Nabble.com.