[R] strange date problem - May 3, 1992 is NA

Petr PIKAL petr.pikal at precheza.cz
Thu Jun 23 09:07:01 CEST 2011


Hi

r-help-bounces at r-project.org napsal dne 22.06.2011 20:40:39:

> On 6/22/2011 1:34 PM, Sarah Goslee wrote:
> > On Wed, Jun 22, 2011 at 2:28 PM, David Winsemius 
<dwinsemius at comcast.net> wrote:
> >>
> >> On Jun 22, 2011, at 2:03 PM, Sarah Goslee wrote:
> >>
> >>> Hi,
> >>>
> >>> On Wed, Jun 22, 2011 at 11:40 AM, Alexander Shenkin 
<ashenkin at ufl.edu>
> >>> wrote:
> >>>>>
> >>>>> is.na(strptime("5/2/1992", format="%m/%d/%Y"))
> >>>>
> >>>> [1] FALSE
> >>>>>
> >>>>> is.na(strptime("5/3/1992", format="%m/%d/%Y"))
> >>>>
> >>>> [1] TRUE
> >>>
> >>> I can't reproduce your problem on R 2.13.0 on linux:
> >>
> >> I also cannot reproduce it on a Mac with 2.13.0 beta
> > 
> > Which strongly suggests that you should start by upgrading your R
> > installation if at all possible.
> > 
> > I'd also recommend trying it on a default R session, with no extra
> > packages loaded, and no items in your workspace. It's possible that
> > something else is interfering.
> > 
> > On linux, that's achieved by typing R --vanilla at the command line.
> > I'm afraid I don't know how to do it for Windows, but should be
> > similarly straightforward.
> > 
> Thanks Sarah.  Still getting the problem.  I should surely upgrade, but
> still, not a bad idea to get to the bottom of this, or at least have it
> documented as a known issue.  BTW, I'm on Windows 7 Pro x64.
> 

Can not reproduce on Windows 2000 on R2.12.0dev (2.13.0 and 2.14.0dev)


> is.na(strptime("5/3/1992", format="%m/%d/%Y"))
[1] FALSE
> sessionInfo()
R version 2.12.0 Under development (unstable) (2010-05-31 r52164)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=Czech_Czech Republic.1250  LC_CTYPE=Czech_Czech 
Republic.1250 
[3] LC_MONETARY=Czech_Czech Republic.1250 LC_NUMERIC=C  
[5] LC_TIME=Czech_Czech Republic.1250 

attached base packages:
[1] stats     grDevices datasets  utils     graphics  methods   base 

other attached packages:
[1] lattice_0.18-8 fun_1.0 

loaded via a namespace (and not attached):
[1] grid_2.12.0  tools_2.12.0
> 


So either some problem with your installation or your OS.
Regards
Petr


> (running Rgui.exe --vanilla):
> 
> > is.na(strptime("5/3/1992", format="%m/%d/%Y"))
> [1] TRUE
> 
> > is.na(strptime("5/2/1992", format="%m/%d/%Y"))
> [1] FALSE
> 
> > sessionInfo()
> R version 2.12.1 (2010-12-16)
> Platform: i386-pc-mingw32/i386 (32-bit)
> 
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> ______________________________________________
> 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.



More information about the R-help mailing list