Hi,

On Wed, Jun 22, 2011 at 11:40 AM, Alexander Shenkin <ashen...@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:

> strptime("5/2/1992", format="%m/%d/%Y")
[1] "1992-05-02"
> is.na(strptime("5/2/1992", format="%m/%d/%Y"))
[1] FALSE
> strptime("5/3/1992", format="%m/%d/%Y")
[1] "1992-05-03"
> is.na(strptime("5/3/1992", format="%m/%d/%Y"))
[1] FALSE

My suspicion is that you imported the data from a spreadsheet and
there's some formatting glitch that's not showing up. If you type the
string "5/3/1992" into the command by hand, do you still get the same
result?

If so, then we need to know your OS and version of R, at least.

> Any idea what's going on with this?  Running strptime against all dates
> from around 1946, only 5/3/1992 was converted as "NA".  Even stranger,
> it still seems to have a value associated with it (even though is.na
> thinks it's NA):
>
>> strptime("5/3/1992", format="%m/%d/%Y")
> [1] "1992-05-03"

This makes no sense to me.

Sarah


-- 
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
R-help@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.

Reply via email to