[R] ISOdatetime gives NA for a specific date

pbarros pbarros at ualg.pt
Tue Feb 10 16:32:49 CET 2009


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.




More information about the R-help mailing list