Extracting date of birth from CPR
cpr_dob.Rd
For easy calculation.
Arguments
- cpr
cpr-numbers as ddmmyy"-."xxxx or ddmmyyxxxx. Also mixed formatting. Vector or data frame column.
Examples
cpr_dob("231045-0637")
#> [1] "1945-10-23"
fsd<-c("010190-2000", "010115-4000", "0101896000","010189-3000","300450-1030","010150-4021")
cpr_dob(fsd)
#> [1] "1990-01-01" "2015-01-01" "1889-01-01" "1989-01-01" "1950-04-30"
#> [6] "1950-01-01"