Learn R Programming

hetu (version 1.1.0)

pin_ctrl: Check Validity of Personal Identity Code

Description

Validate Finnish personal identity codes (hetu).

Usage

pin_ctrl(pin, allow.temp = FALSE)

hetu_ctrl(pin, allow.temp = FALSE)

Value

A logical vector indicating whether the input vector contains valid Finnish personal identity codes.

Arguments

pin

Finnish personal identity code(s) as a character vector

allow.temp

If TRUE, temporary PINs (personal numbers 900-999) are handled similarly to regular PINs (personal numbers 002-899), meaning that otherwise valid temporary PIN will return a TRUE. Default is FALSE.

Author

Pyry Kantanen

See Also

hetu For extracting information from Finnish personal identity codes.

Examples

Run this code
pin_ctrl("010101-0101") # TRUE
pin_ctrl("010101-010A") # FALSE
pin_ctrl(c("010101-0101", "010101-010A")) # TRUE FALSE
hetu_ctrl("010101-0101") # TRUE
hetu_ctrl("010101-010A") # FALSE
hetu_ctrl(c("010101-0101", "010101-010A")) # TRUE FALSE

Run the code above in your browser using DataLab