On Jan 17, 2012, at 8:02 AM, Thomas Mang wrote:
On 1/11/2012 11:07 PM, Paul Miller wrote:
Hello Everyone,
I have a question about how best to check dates for entry errors.
Try using regular expression matching and the functions grep,
strsplit, regexpr etc.
If you are not familiar with regex: bit a bumpy road of getting into
it but in the long term definitely worth the effort !
Agree on all points, but also simply converting to the Date class and
using the ?Comparison operators is informative. And there may be NA's
that will signal impossible month-day combinations which would be
tedious to identify with regex.
--
David Winsemius, MD
West Hartford, CT
______________________________________________
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.