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

Alexander Shenkin ashenkin at ufl.edu
Wed Jun 22 20:40:39 CEST 2011


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.

(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



More information about the R-help mailing list