Extracting date of birth from CPR
cpr_dob.Rd
For easy calculation. Does not handle cprs with letters (interim cpr)
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("2310450637", "010190-2000", "010115-4000","300450-1030","010150-4021")
cpr_dob(fsd)
#> [1] "1945-10-23" "1990-01-01" "2015-01-01" "1950-04-30" "1950-01-01"