pin_age | R Documentation |
pin
for a given dateCalculate the age in full years for a given date.
pin_age(pin, date = Sys.Date(), timespan = "years", verbose = TRUE)
pin |
A vector of class |
date |
Date at which age is calculated. If a vector is provided it must be
of the same length as the |
timespan |
Timespan to use to calculate age. The actual timespans are:
|
verbose |
Should messages be printed? Default is |
Age as an integer vector.
Skatteverket, Personnummer. SKV 704. (2007)
# Example with someone born today
today_pin <-
paste(paste(unlist(strsplit(as.character(Sys.Date()),split = "-")), collapse = ""),
"0000",sep="")
pin_age(today_pin)
# Examples taken from SKV 704 (see references)
ex_pin <- c("196408233234", "186408833224")
pin_age(ex_pin, date = "2012-01-01")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.