Learn R Programming

hetu (version 1.0.1)

hetu_diagnostic: Diagnostics Tool for HETU

Description

Produce a data frame of PINs that may require closer scrutiny.

Usage

hetu_diagnostic(pin, extract = NULL, subsetting = FALSE)

pin_diagnostic(pin, extract = NULL, subsetting = FALSE)

Arguments

pin

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

extract

Extract only selected part of the diagnostic information. Valid values are "hetu", "is.temp", "valid.p.num", "valid.checksum", "correct.checksum", "valid.date", "valid.day", "valid.month", "valid.length", "valid.century". If NULL (default), returns all information.

subsetting

Print only PINs where the validity check chosen in extract returns FALSE.

Value

A data.frame containing diagnostic checks about PINs.

Examples

Run this code
# NOT RUN {
diagnosis_example <- c("010101-0102", "111111-111Q", 
"010101B0101", "320101-0101", "011301-0101", 
"010101-01010", "010101-0011")
## Print all diagnoses
hetu_diagnostic(diagnosis_example)
# Extract century-related checks
hetu_diagnostic(diagnosis_example, extract = "valid.century")
# Extract only rows where invalid.checksum = TRUE
hetu_diagnostic(diagnosis_example, subsetting = TRUE, extract = "valid.checksum") 

diagnosis_example <- c("010101-0102", "111111-111Q", 
"010101B0101", "320101-0101", "011301-0101", 
"010101-01010", "010101-0011")
## Print all diagnoses
pin_diagnostic(diagnosis_example)
# }

Run the code above in your browser using DataLab