Re: [R] Checking dates for entry errors

2012-01-18 Thread Terry Therneau
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. It depends on the study. 1. Simple: use as.Date on the data, and find resultant missing values. You might have to add a format to the as.Date call: if I use as.Date("

Re: [R] Checking dates for entry errors

2012-01-17 Thread David Winsemius
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 reg

Re: [R] Checking dates for entry errors

2012-01-17 Thread Thomas Mang
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

[R] Checking dates for entry errors

2012-01-11 Thread Paul Miller
Hello Everyone,   I have a question about how best to check dates for entry errors. I recently discovered that R will read the incorrectly entered date "11/23/21931" without producing a warning or an error message at least under some circumstances.   > as.Date("11/23/21931", format = "%m/%d/%Y")