Learn R Programming

sorvi (version 0.7.26)

hetu: Extract information from Finnish personal identification numbers (hetu)

Description

Extract information from Finnish personal identification numbers (hetu)

Usage

hetu(hetu, extract = NULL)

Arguments

hetu

Finnish personal identification number as a character vector, or vector of identification numbers as a character vectors

extract

Extract only selected part of the information. Valid values are "hetu", "gender", "personal.number", "checksum", "date", "day", "month", "year", "century.char". If NULL (default), returns all information.

Value

Finnish personal identification number data.frame, or if extract parameter is set, the requested part of the information as a vector. Returns NA if the given character vector is not a valid Finnish personal identification number.

hetu

Finnish personal identification number as a character vector.

gender

Gender of the person as a character vector ("Male" or "Female").

personal.number

Personal number part of the identification number.

checksum

Checksum for the personal identification number.

date

Birthdate.

day

Day of the birthdate.

month

Month of the birthdate.

year

Year of the birthdate.

century.char

Century character of the birthdate: + (1800), - (1900) or A (2000).

See Also

valid_hetu For validating Finnish personal identification numbers.

Examples

Run this code
# NOT RUN {
hetu("111111-111C")
hetu("111111-111C")$date
hetu("111111-111C")$gender
# Same as previous, but using extract argument
hetu("111111-111C", extract="gender")

# Process a vector of hetu's
hetu(c("010101-0101", "111111-111C"))

# Process a vector of hetu's and extract gender information from each
hetu(c("010101-0101", "111111-111C"), extract="gender")
# }

Run the code above in your browser using DataLab