[R] date to age

2003-06-30 Thread William Briggs
I have files which have columns of data that look like this: DOB 9/27/1964 ... That is, dates in month/day/year format. When variables like DOB are read in, they are converted to factors. So, I wrote this to convert from date to age in years: age-function(x)

Re: [R] date to age

2003-06-30 Thread Prof Brian Ripley
On Mon, 30 Jun 2003, William Briggs wrote: I have files which have columns of data that look like this: DOB 9/27/1964 ... That is, dates in month/day/year format. When variables like DOB are read in, they are converted to factors. Why? You can avoid that, of course. So, I wrote