knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
Calculate date of birth, age, and gender, and generate anonymous sequence numbers from CPR numbers. Also modulo 11 check is available, though this function is only relevant for cpr numbers until 2007.
# Load cprr. library(cprr) # Make vector of example cpr numbers. cpr <- c('1508631111', '020962-4444', '131076-2222', '1508631111', '2110625629') # Caluculate dates of birth from cpr numbers. dob(cpr) # Calculate ages from cpr numbers. age(cpr) # Calculate genders from cpr numbers. gender(cpr) # Generate anonymous sequence numbers from cpr numbers. scramble(cpr) # Perform modulo 11 check of cpr numbers. mod11(cpr) # Make data frame from build in data set of official test cpr numbers. cpr <- test_cpr$cpr data.frame( cpr = cpr, id = scramble(cpr), dob = dob(cpr), gender = gender(cpr), mod11 = mod11(cpr) )
You can install development version from github:
# install.packages("devtools") devtools::install_github("anhoej/cprr")
Or stable version from CRAN:
install.packages("cprr")
The Danish Personal Identification number (Danish: CPR-nummer or personnummer) is a national identification number, which is part of the personal information stored in the Civil Registration System (Danish: Det Centrale Personregister).
It is a ten-digit number with the format DDMMYY-SSSS, where DDMMYY is the date of birth and SSSS is a sequence number. The first digit of the sequence number encodes the century of birth (so that centenarians are distinguished from infants), and the last digit of the sequence number is odd for males and even for females.
The civil register lists only persons who:
Danish citizens, including newborn babies, who are entitled to Danish citizenship, but are living abroad, do not receive a personal ID number, unless they move to Denmark.
Source: https://en.wikipedia.org/wiki/Personal_identification_number_(Denmark)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.