The date library was written 20 or so years ago.  It was a very good
first effort, but the newer Date library has superior functionality in
nearly every way.   The date library is still available, for legacy
projects such as yours, but I do not advise it for new work.  To answer
your specific questions:

1. What you have is a real bug.  The underlying C routine that scans
through the text returns "0" as a marker for any string it can't figure
out, a year of 'abc'  or month 'charlie' for example.  The S function
then turns these into NA.   I never, ever thought about year 0.  In our
longer term studies at Mayo we have birth dates in the 1800s, it is
rather surprising that a birth date of 1900 hadn't caught me sometime in
the past.  I'll  fix this.

2. The date library predates the strptime function by over 10 years.  It
is not a huge surprise that I neglected to include support for it -- my
oracular abilities are limited.  For an inherited project such as this I
would suggest reading the date() documentation as a first step; it is
not very long since the package is simple.
You want the date.mdy function, which is more straightforward than
strptime (with less capabilities of course).

Terry Therneau


        [[alternative HTML version deleted]]

______________________________________________
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