hetu: Extract information from Finnish personal identification...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/hetu.R

Description

Extract information from Finnish personal identification numbers (hetu)

Usage

1
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).

Author(s)

Jussi Paananen [email protected]

See Also

valid_hetu For validating Finnish personal identification numbers.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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")

Example output

sorvi - Tools for Finnish Open Data.
Copyright (C) 2010-2015 Leo Lahti, Juuso Parkkinen, Juuso Haapanen, Einari Happonen, Jussi Paananen, Joona Lehtomaki ym.

http://github.com/ropengov/sorvi 

 Hard sciences are successful because they deal with soft problems; 
 soft sciences are struggling because they deal with hard problems.
-                        Von Foerster

         hetu gender personal.number checksum       date day month year
1 111111-111C   Male             111        C 1911-11-11  11    11 1911
  century.char
1            -
[1] "1911-11-11"
[1] Male
Levels: Male
[1] "Male"
         hetu gender personal.number checksum       date day month year
1 010101-0101 Female              10        1 1901-01-01   1     1 1901
2 111111-111C   Male             111        C 1911-11-11  11    11 1911
  century.char
1            -
2            -
[1] "Female" "Male"  

sorvi documentation built on May 2, 2019, 3:25 a.m.