I am working with date data. Below is sample data:
id dob
1 8/2/48
2 12/13/34
I am using the code below to transform the date data from %m/%d/%y to y-m-d.
library(read_r)
df$new_dob <- parse_datetime(df$date_birth, "%m/%d/%y")
Using this code, I get the data in the right format, but the year is off.
id dob new_dob
1 8/2/48 2048-08-02
2 12/13/34 2034-12-13
It should be this:
id dob new_dob
1 8/2/48 1948-08-02
2 12/13/34 1934-12-13
Does anyone know how I can get this to work?