hetu {hetu} | R Documentation |
Generic Extraction Tool for Finnish Personal Identity Codes
Description
Extract embedded information from Finnish personal identity codes (hetu).
Usage
hetu(pin, extract = NULL, allow.temp = FALSE, diagnostic = FALSE)
Arguments
pin |
Finnish personal identity code(s) as a character vector |
extract |
Extract only selected part of the information.
Valid values are " |
allow.temp |
Allow artificial or temporary PINs (personal numbers
900-999). If |
diagnostic |
Print additional information about possible problems in
PINs. The checks are " |
Value
Finnish personal identity code data.frame,
or if extract parameter is set, the requested part of the
information as a vector. Returns an error or NA
if the given
character vector is not a valid Finnish personal identity code.
hetu |
Finnish personal identity code as a character vector. A correct pin should be in the form DDMMYYCZZZQ, where DDMMYY stands for date, C for century sign, ZZZ for personal number and Q for control character. |
sex |
sex of the person as a character vector ("Male" or "Female"). |
p.num |
Personal number part of the identity code. |
ctrl.char |
Control character for the personal identity code. |
date |
Birthdate. |
day |
Day of the birthdate. |
month |
Month of the birthdate. |
year |
Year of the birthdate. |
century |
Century character of the birthdate: + (1800), - (1900) or A (2000). |
valid.pin |
Does the personal identity code pass all validity
checks: ( |
Author(s)
Pyry Kantanen, Jussi Paananen
See Also
pin_ctrl
For validating Finnish personal
identity codes.
Examples
hetu("111111-111C")
hetu("111111-111C")$date
hetu("111111-111C")$sex
# Same as previous, but using extract argument
hetu("111111-111C", extract="sex")
# Process a vector of hetu's
hetu(c("010101-0101", "111111-111C"))
# Process a vector of hetu's and extract sex information from each
hetu(c("010101-0101", "111111-111C"), extract="sex")