How to solve annoying issue, arising due to format of dataset, on as.Date in R? Date is formatted as dd-m-yy,

20 views Asked by At

On R have a dataset with names and dates of birth. Some dates of birth are past the millennium and others are before. The date is in the format 11-Apr-59, so when use:

df$dob<- as.Date(df$dob, format ="%d-%b-%y")

The problem is that this is converting people with the DOB to 11/04/2059 and I don't know how to resolve it. The DOBs are between 1930 and 2024.

Any help would be appreciated. Thanks!

0

There are 0 answers