Commit 48ce9657 authored by Pyry Kantanen's avatar Pyry Kantanen
Browse files

Final fixes before submit to CRAN

parent 04671b80
Package: hetu
Type: Package
Title: Structural Handling of Finnish Personal Identity Codes
Version: 1.0.7.9000
Date: 2022-05-16
Version: 1.0.7
Date: 2022-05-20
Authors@R:
c(
person(given = "Pyry",
......@@ -37,7 +37,7 @@ License: BSD_2_clause + file LICENSE
VignetteBuilder: knitr
Encoding: UTF-8
BugReports: https://github.com/ropengov/hetu/issues
URL: https://ropengov.github.io/hetu, https://github.com/ropengov/hetu
URL: https://ropengov.github.io/hetu/, https://github.com/ropengov/hetu
Depends:
R (>= 3.6.0)
Imports:
......
#' @title Finnish personal identification number extraction
#' @description Extract information from Finnish personal identification
#' numbers (hetu).
#' @param pin Finnish personal identification number as a character vector,
#' or vector of identification numbers as a character vectors
#' @title Generic Extraction Tool for Finnish Personal Identity Codes
#' @description Extract embedded information from Finnish personal identity
#' codes (hetu).
#' @param pin Finnish personal identity code(s) as a character vector
#' @param extract Extract only selected part of the information.
#' Valid values are "\code{hetu}", "\code{sex}", "\code{p.num}",
#' "\code{ctrl.char}", "\code{date}", "\code{day}", "\code{month}",
......@@ -16,28 +15,28 @@
#' "\code{correct.ctrl.char}", "\code{valid.date}", "\code{valid.day}",
#' "\code{valid.month}", "\code{valid.length}", "\code{valid.century}".
#' Default is \code{FALSE} which returns no diagnostic information.
#' @return Finnish personal identification number data.frame,
#' @return 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 \code{NA} if the given
#' character vector is not a valid Finnish personal identification number.
#' \item{hetu}{Finnish personal identification number as a character vector.
#' character vector is not a valid Finnish personal identity code.
#' \item{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.}
#' \item{sex}{sex of the person as a character vector ("Male" or "Female").}
#' \item{p.num}{Personal number part of the identification number.}
#' \item{ctrl.char}{Control character for the personal identification number.}
#' \item{p.num}{Personal number part of the identity code.}
#' \item{ctrl.char}{Control character for the personal identity code.}
#' \item{date}{Birthdate.}
#' \item{day}{Day of the birthdate.}
#' \item{month}{Month of the birthdate.}
#' \item{year}{Year of the birthdate.}
#' \item{century}{Century character of the birthdate: + (1800), - (1900) or
#' A (2000).}
#' \item{valid.pin}{Does the personal identification number pass all validity
#' \item{valid.pin}{Does the personal identity code pass all validity
#' checks: (\code{TRUE} or \code{FALSE})}
#' @author Pyry Kantanen, Jussi Paananen
#' @seealso \code{\link{pin_ctrl}} For validating Finnish personal
#' identification numbers.
#' identity codes.
#' @examples
#' hetu("111111-111C")
#' hetu("111111-111C")$date
......@@ -126,7 +125,7 @@ hetu <- function(pin, extract = NULL, allow.temp = FALSE, diagnostic = FALSE) {
names(checklist) <- 0:30
valid_ctrl_char_test <- extracted_ctrl_char %in% checklist
# Get personal identification number
# Get personal identity code
extracted_personal_number <- substr(pin, start = 8, stop = 10)
extracted_personal_number <- formatC(extracted_personal_number,
width = 3, format = "d", flag = "0")
......@@ -143,7 +142,7 @@ hetu <- function(pin, extract = NULL, allow.temp = FALSE, diagnostic = FALSE) {
extracted_sex <- ifelse(((as.numeric(extracted_personal_number) %% 2) == 0),
"Female", "Male")
# Check if personal identification number is artificial or temporary
# Check if personal identity code is artificial or temporary
is_temp_test <- as.numeric(extracted_personal_number) >= 900
# Check pin number of characters
......
#' @title Finnish Personal Identification Number Control Character Calculator
#' @title Calculate Control Character for Personal Identity Code
#' @description Calculate a valid control character for an incomplete
#' Finnish personal identification numbers (hetu).
#' Finnish personal identity codes (hetu).
#' @param pin An incomplete PIN that ONLY has a date, century marker (optional,
#' see parameter with.century) and personal number
#' @param with.century If TRUE (default), the function assumes that the PIN
......@@ -19,7 +19,7 @@
#' @return Control character, either a number 0-9 or a letter.
#' @author Pyry Kantanen
#' @seealso \code{\link{hetu}} For extracting information from Finnish personal
#' identification numbers.
#' identity codes.
#' @examples
#' hetu_control_char("010101-010")
#' hetu_control_char("010101010", with.century = FALSE)
......
## hetu_diagnostic.R
#' @title Diagnostics Tool for HETU
#' @description Produce a data frame of PINs that may require closer scrutiny.
#' @title Diagnostics Tool for Personal Identity Codes
#' @description Prints information on the tests that are used
#' to confirm or reject the validity of each personal identity code.
#' @param pin Finnish personal identification number as a character vector,
#' or vector of identification numbers as a character vectors
#' @param extract Extract only selected part of the diagnostic information.
......@@ -17,6 +18,8 @@
#' hetu_diagnostic(diagnosis_example)
#' # Extract century-related checks
#' hetu_diagnostic(diagnosis_example, extract = "valid.century")
#' @seealso \code{\link{hetu}} for the main function on which
#' \code{hetu_diagnostic} relies on.
#'
#' @export
hetu_diagnostic <- function(pin, extract = NULL) {
......
#' @title Age from ID
#' @description Calculate the age in full years for a given date.
#' @title Extract Age from Personal Identity Code
#' @description Calculate age in years, months, weeks or days from
#' personal identity codes.
#' @inheritParams hetu
#' @param date Date at which age is calculated. If a vector is provided it
#' must be of the same length as the \code{pin} argument.
......
#' @title Finnish Personal Identification Number Validator
#' @description Validate Finnish personal identification numbers (hetu).
#' @param pin Finnish personal identification number as a character vector, or
#' vector of identification numbers as a character vectors.
#' @title Check Validity of Personal Identity Code
#' @description Validate Finnish personal identity codes (hetu).
#' @param pin Finnish personal identity code(s) as a character vector
#' @param 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
......@@ -10,7 +9,7 @@
#' Finnish personal identity codes.
#' @author Pyry Kantanen
#' @seealso \code{\link{hetu}} For extracting information from Finnish personal
#' identification numbers.
#' identity codes.
#' @examples
#' pin_ctrl("010101-0101") # TRUE
#' pin_ctrl("010101-010A") # FALSE
......@@ -31,7 +30,7 @@ pin_ctrl <- function(pin, allow.temp = FALSE) {
#' @export
hetu_ctrl <- pin_ctrl
#' @title Check Finnish Business ID (y-tunnus) validity
#' @title Check Validity of Finnish Business ID (Y-tunnus)
#'
#' @description
#' A function that checks whether a \code{bid} (Finnish Business ID) is valid.
......@@ -100,7 +99,7 @@ bid_ctrl <- function(bid) {
return(check)
}
#' @title Check Finnish Unique Identification Number validity
#' @title Check Validity of Finnish Unique Identification Number (SATU)
#'
#' @description
#' A function that checks whether a \code{satu} (Finnish Unique Identification
......
#' @title Get Birth date from PIN
#' @description Calculates the date of birth in date format.
#' @title Extract Date of Birth from Personal Identity Code
#' @description Returns the date of birth in date format.
#' @inheritParams hetu
#' @return Date of birth as a vector in date format.
#' @examples
......
#' @title Sex From ID
#' @description Extract sex from Finnish personal identification number.
#' @title Extract Sex from Personal Identity Code
#' @description Extract sex (as binary) from Finnish personal identification
#' code.
#' @inheritParams hetu
#' @return Factor with label 'Male' and 'Female'.
#' @author Pyry Kantanen, Leo Lahti
......
#' @title Generate a vector of random \code{hetu}
#' @title Generate Random Personal Identity Codes
#'
#' @description
#' A function that generates random \code{hetu}-pins.
#' A function that generates random Finnish personal identity codes
#' (\code{hetu} codes).
#'
#' @details
#' There is a finite number of valid personal identity codes available per day.
......@@ -125,7 +126,7 @@ rpin <- function(n,
#' @export
rhetu <- rpin
#' @title Generate a vector of random Finnish Business ID's (y-tunnus)
#' @title Generate Random Finnish Business ID's (Y-tunnus)
#'
#' @description
#' A function that generates random Finnish Business ID's, \code{bid}-numbers
......
......@@ -13,15 +13,15 @@ knitr::opts_chunk$set(
<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- badges: start -->
[![rOG-badge](https://ropengov.github.io/rogtemplate/reference/figures/ropengov-badge.svg)](http://ropengov.org/)
[![rOG-badge](https://ropengov.github.io/rogtemplate/reference/figures/ropengov-badge.svg)](https://ropengov.org/)
[![R build status](https://github.com/rOpenGov/hetu/workflows/R-CMD-check/badge.svg)](https://github.com/rOpenGov/hetu/actions)
[![codecov](https://codecov.io/gh/rOpenGov/hetu/branch/master/graph/badge.svg)](https://codecov.io/gh/rOpenGov/hetu)
[![codecov](https://codecov.io/gh/rOpenGov/hetu/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rOpenGov/hetu)
[![Downloads](http://cranlogs.r-pkg.org/badges/grand-total/hetu)](https://cran.r-project.org/package=hetu)
[![Downloads](http://cranlogs.r-pkg.org/badges/hetu)](https://cran.r-project.org/package=hetu)
[![Watch on GitHub][github-watch-badge]][github-watch]
[![Star on GitHub][github-star-badge]][github-star]
[![Follow](https://img.shields.io/twitter/follow/ropengov.svg?style=social)](https://twitter.com/intent/follow?screen_name=ropengov)
[![cran version](http://www.r-pkg.org/badges/version/hetu)](http://cran.rstudio.com/web/packages/hetu)
[![cran version](http://www.r-pkg.org/badges/version/hetu)](https://CRAN.R-project.org/package=hetu)
<!-- badges: end -->
<!--[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/grand-total/hetu)](https://github.com/metacran/cranlogs.app)-->
......@@ -30,9 +30,9 @@ knitr::opts_chunk$set(
### Introduction
`hetu` is an R package for structural handling of national identification numbers used in Finland, or more specifically Finnish personal identity codes (in Finnish: henkilötunnus (hetu), in Swedish: personbeteckning). Some functions can also be used with Finnish Business ID numbers (y-tunnus).
`hetu` is an R package for structural handling of identification codes used in Finland, most importantly Finnish flavour of national identification numbers, the Finnish personal identity codes (in Finnish: henkilötunnus (hetu), in Swedish: personbeteckning). Some functions can also be used with Finnish Business ID numbers (in Finnish: yritys- ja yhteisötunnus (y-tunnus), in Swedish: företags- och organisationsnummer (FO-nummer)) and Finnish Unique Identification Numbers (FINUID, in Finnish: sähköinen asiointitunnus (SATU), in Swedish: elektronisk kommunikationskod).
The syntax in this package is unified with the similar package for Swedish ID numbers, the [sweidnumbr](https://github.com/rOpenGov/sweidnumbr).
The syntax in this package aims to be, when convenient, similar with another package specializing in national identification numbers: the [sweidnumbr](https://github.com/rOpenGov/sweidnumbr) R package for working with Swedish personal identity numbers and corporation identity numbers.
### Installation
......@@ -93,13 +93,13 @@ vignette("hetu")
* [Submit suggestions and bug reports](https://github.com/ropengov/hetu/issues) (provide the output of `sessionInfo()` and `packageVersion("hetu")` and preferably provide a [reproducible example](http://adv-r.had.co.nz/Reproducibility.html))
* [Send a pull request](https://github.com/rOpenGov/hetu/pulls)
* [Star us on the Github page](https://github.com/ropengov/hetu/)
* [See our website](http://ropengov.org/community/) for additional contact information
* [See our website](https://ropengov.org/community/) for additional contact information
## Acknowledgements
**Kindly cite this work** as follows: [Pyry Kantanen](http://github.com/pitkant/), Måns Magnusson, Jussi Paananen, Leo Lahti. hetu: Finnish personal ID number data toolkit for R. URL: [http://ropengov.github.io/hetu/](http://ropengov.github.io/hetu/)
**Kindly cite this work** as follows: [Pyry Kantanen](https://github.com/pitkant/), Måns Magnusson, Jussi Paananen, Leo Lahti. hetu: Finnish personal ID number data toolkit for R. URL: [https://ropengov.github.io/hetu/](https://ropengov.github.io/hetu/)
We are grateful to all [contributors](https://github.com/rOpenGov/hetu/graphs/contributors)! This project is part of [rOpenGov](http://ropengov.org).
We are grateful to all [contributors](https://github.com/rOpenGov/hetu/graphs/contributors)! This project is part of [rOpenGov](https://ropengov.org).
[github-watch-badge]: https://img.shields.io/github/watchers/ropengov/hetu.svg?style=social
[github-watch]: https://github.com/ropengov/hetu/watchers
......
<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- badges: start -->
[![rOG-badge](https://ropengov.github.io/rogtemplate/reference/figures/ropengov-badge.svg)](http://ropengov.org/)
[![rOG-badge](https://ropengov.github.io/rogtemplate/reference/figures/ropengov-badge.svg)](https://ropengov.org/)
[![R build
status](https://github.com/rOpenGov/hetu/workflows/R-CMD-check/badge.svg)](https://github.com/rOpenGov/hetu/actions)
[![codecov](https://codecov.io/gh/rOpenGov/hetu/branch/master/graph/badge.svg)](https://codecov.io/gh/rOpenGov/hetu)
[![codecov](https://codecov.io/gh/rOpenGov/hetu/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rOpenGov/hetu)
[![Downloads](http://cranlogs.r-pkg.org/badges/grand-total/hetu)](https://cran.r-project.org/package=hetu)
[![Downloads](http://cranlogs.r-pkg.org/badges/hetu)](https://cran.r-project.org/package=hetu)
[![Watch on
......@@ -15,7 +14,7 @@ GitHub](https://img.shields.io/github/watchers/ropengov/hetu.svg?style=social)](
GitHub](https://img.shields.io/github/stars/ropengov/hetu.svg?style=social)](https://github.com/ropengov/hetu/stargazers)
[![Follow](https://img.shields.io/twitter/follow/ropengov.svg?style=social)](https://twitter.com/intent/follow?screen_name=ropengov)
[![cran
version](http://www.r-pkg.org/badges/version/hetu)](http://cran.rstudio.com/web/packages/hetu)
version](http://www.r-pkg.org/badges/version/hetu)](https://CRAN.R-project.org/package=hetu)
<!-- badges: end -->
<!--[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/grand-total/hetu)](https://github.com/metacran/cranlogs.app)-->
......@@ -101,23 +100,23 @@ vignette("hetu")
## Contributing
- [Submit suggestions and bug
- [Submit suggestions and bug
reports](https://github.com/ropengov/hetu/issues) (provide the
output of `sessionInfo()` and `packageVersion("hetu")` and
preferably provide a [reproducible
example](http://adv-r.had.co.nz/Reproducibility.html))
- [Send a pull request](https://github.com/rOpenGov/hetu/pulls)
- [Star us on the Github page](https://github.com/ropengov/hetu/)
- [See our website](http://ropengov.org/community/) for additional
- [Send a pull request](https://github.com/rOpenGov/hetu/pulls)
- [Star us on the Github page](https://github.com/ropengov/hetu/)
- [See our website](https://ropengov.org/community/) for additional
contact information
## Acknowledgements
**Kindly cite this work** as follows: [Pyry
Kantanen](http://github.com/pitkant/), Måns Magnusson, Jussi Paananen,
Kantanen](https://github.com/pitkant/), Måns Magnusson, Jussi Paananen,
Leo Lahti. hetu: Finnish personal ID number data toolkit for R. URL:
<http://ropengov.github.io/hetu/>
<https://ropengov.github.io/hetu/>
We are grateful to all
[contributors](https://github.com/rOpenGov/hetu/graphs/contributors)\!
This project is part of [rOpenGov](http://ropengov.org).
[contributors](https://github.com/rOpenGov/hetu/graphs/contributors)!
This project is part of [rOpenGov](https://ropengov.org).
## Test environments
* local macOS 10.15.7 install, R 4.0.3
* ubuntu 20.04, R 4.0.0
* local macOS 12.4 install (Intel 64-bit), R 4.2.0
* win-builder (devel and release)
* R-CMD-check workflow (macOS-latest, windows-latest, ubuntu-latest-devel, ubuntu-latest-release, ubuntu-latest-oldrel-1)
## R CMD check results
There were no ERRORs or WARNINGs.
There was 1 NOTE:
* checking CRAN incoming feasibility ... NOTE
Maintainer: ‘Pyry Kantanen <pyry.kantanen@gmail.com>
New submission
There were no ERRORs or WARNINGs.
## Downstream dependencies
......
......@@ -2,7 +2,7 @@
% Please edit documentation in R/pin_ctrl.R
\name{bid_ctrl}
\alias{bid_ctrl}
\title{Check Finnish Business ID (y-tunnus) validity}
\title{Check Validity of Finnish Business ID (Y-tunnus)}
\usage{
bid_ctrl(bid)
}
......
......@@ -2,13 +2,12 @@
% Please edit documentation in R/hetu.R
\name{hetu}
\alias{hetu}
\title{Finnish personal identification number extraction}
\title{Generic Extraction Tool for Finnish Personal Identity Codes}
\usage{
hetu(pin, extract = NULL, allow.temp = FALSE, diagnostic = FALSE)
}
\arguments{
\item{pin}{Finnish personal identification number as a character vector,
or vector of identification numbers as a character vectors}
\item{pin}{Finnish personal identity code(s) as a character vector}
\item{extract}{Extract only selected part of the information.
Valid values are "\code{hetu}", "\code{sex}", "\code{p.num}",
......@@ -27,29 +26,29 @@ PINs. The checks are "\code{valid.p.num}", "\code{valid.ctrl.char}",
Default is \code{FALSE} which returns no diagnostic information.}
}
\value{
Finnish personal identification number data.frame,
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 \code{NA} if the given
character vector is not a valid Finnish personal identification number.
\item{hetu}{Finnish personal identification number as a character vector.
character vector is not a valid Finnish personal identity code.
\item{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.}
\item{sex}{sex of the person as a character vector ("Male" or "Female").}
\item{p.num}{Personal number part of the identification number.}
\item{ctrl.char}{Control character for the personal identification number.}
\item{p.num}{Personal number part of the identity code.}
\item{ctrl.char}{Control character for the personal identity code.}
\item{date}{Birthdate.}
\item{day}{Day of the birthdate.}
\item{month}{Month of the birthdate.}
\item{year}{Year of the birthdate.}
\item{century}{Century character of the birthdate: + (1800), - (1900) or
A (2000).}
\item{valid.pin}{Does the personal identification number pass all validity
\item{valid.pin}{Does the personal identity code pass all validity
checks: (\code{TRUE} or \code{FALSE})}
}
\description{
Extract information from Finnish personal identification
numbers (hetu).
Extract embedded information from Finnish personal identity
codes (hetu).
}
\examples{
hetu("111111-111C")
......@@ -65,7 +64,7 @@ hetu(c("010101-0101", "111111-111C"), extract="sex")
}
\seealso{
\code{\link{pin_ctrl}} For validating Finnish personal
identification numbers.
identity codes.
}
\author{
Pyry Kantanen, Jussi Paananen
......
......@@ -2,7 +2,7 @@
% Please edit documentation in R/hetu_control_char.R
\name{hetu_control_char}
\alias{hetu_control_char}
\title{Finnish Personal Identification Number Control Character Calculator}
\title{Calculate Control Character for Personal Identity Code}
\usage{
hetu_control_char(pin, with.century = TRUE)
}
......@@ -19,7 +19,7 @@ Control character, either a number 0-9 or a letter.
}
\description{
Calculate a valid control character for an incomplete
Finnish personal identification numbers (hetu).
Finnish personal identity codes (hetu).
}
\details{
This method of calculating the control character was devised by
......@@ -39,7 +39,7 @@ hetu_control_char("010101010", with.century = FALSE)
}
\seealso{
\code{\link{hetu}} For extracting information from Finnish personal
identification numbers.
identity codes.
}
\author{
Pyry Kantanen
......
......@@ -3,7 +3,7 @@
\name{hetu_diagnostic}
\alias{hetu_diagnostic}
\alias{pin_diagnostic}
\title{Diagnostics Tool for HETU}
\title{Diagnostics Tool for Personal Identity Codes}
\usage{
hetu_diagnostic(pin, extract = NULL)
......@@ -23,7 +23,8 @@ Valid values are "\code{hetu}", "\code{is.temp}", "\code{valid.p.num}",
A data.frame containing diagnostic checks about PINs.
}
\description{
Produce a data frame of PINs that may require closer scrutiny.
Prints information on the tests that are used
to confirm or reject the validity of each personal identity code.
}
\examples{
diagnosis_example <- c("010101-0102", "111111-111Q",
......@@ -33,10 +34,13 @@ diagnosis_example <- c("010101-0102", "111111-111Q",
hetu_diagnostic(diagnosis_example)
# Extract century-related checks
hetu_diagnostic(diagnosis_example, extract = "valid.century")
diagnosis_example <- c("010101-0102", "111111-111Q",
"010101B0101", "320101-0101", "011301-0101",
"010101-01010", "010101-0011")
## Print all diagnoses
pin_diagnostic(diagnosis_example)
}
\seealso{
\code{\link{hetu}} for the main function on which
\code{hetu_diagnostic} relies on.
}
......@@ -3,15 +3,14 @@
\name{pin_age}
\alias{pin_age}
\alias{hetu_age}
\title{Age from ID}
\title{Extract Age from Personal Identity Code}
\usage{
pin_age(pin, date = Sys.Date(), timespan = "years", allow.temp = FALSE)
hetu_age(pin, date = Sys.Date(), timespan = "years", allow.temp = FALSE)
}
\arguments{
\item{pin}{Finnish personal identification number as a character vector,
or vector of identification numbers as a character vectors}
\item{pin}{Finnish personal identity code(s) as a character vector}
\item{date}{Date at which age is calculated. If a vector is provided it
must be of the same length as the \code{pin} argument.}
......@@ -32,7 +31,8 @@ use (personal numbers 002-899) are allowed.}
Age as an integer vector.
}
\description{
Calculate the age in full years for a given date.
Calculate age in years, months, weeks or days from
personal identity codes.
}
\examples{
ex_pin <- c("010101-0101", "111111-111C")
......
......@@ -3,15 +3,14 @@
\name{pin_ctrl}
\alias{pin_ctrl}
\alias{hetu_ctrl}
\title{Finnish Personal Identification Number Validator}
\title{Check Validity of Personal Identity Code}
\usage{
pin_ctrl(pin, allow.temp = FALSE)
hetu_ctrl(pin, allow.temp = FALSE)
}
\arguments{
\item{pin}{Finnish personal identification number as a character vector, or
vector of identification numbers as a character vectors.}
\item{pin}{Finnish personal identity code(s) as a character vector}
\item{allow.temp}{If TRUE, temporary PINs (personal numbers 900-999) are
handled similarly to regular PINs (personal numbers 002-899), meaning
......@@ -23,7 +22,7 @@ A logical vector indicating whether the input vector contains valid
Finnish personal identity codes.
}
\description{
Validate Finnish personal identification numbers (hetu).
Validate Finnish personal identity codes (hetu).
}
\examples{
pin_ctrl("010101-0101") # TRUE
......@@ -35,7 +34,7 @@ hetu_ctrl(c("010101-0101", "010101-010A")) # TRUE FALSE
}
\seealso{
\code{\link{hetu}} For extracting information from Finnish personal
identification numbers.
identity codes.
}
\author{
Pyry Kantanen
......
......@@ -3,15 +3,14 @@
\name{pin_date}
\alias{pin_date}
\alias{hetu_date}
\title{Get Birth date from PIN}
\title{Extract Date of Birth from Personal Identity Code}
\usage{
pin_date(pin, allow.temp = FALSE)
hetu_date(pin, allow.temp = FALSE)
}
\arguments{
\item{pin}{Finnish personal identification number as a character vector,
or vector of identification numbers as a character vectors}
\item{pin}{Finnish personal identity code(s) as a character vector}
\item{allow.temp}{Allow artificial or temporary PINs (personal numbers
900-999). If \code{FALSE} (default), only PINs intended for official
......@@ -21,7 +20,7 @@ use (personal numbers 002-899) are allowed.}
Date of birth as a vector in date format.
}
\description{
Calculates the date of birth in date format.
Returns the date of birth in date format.
}
\examples{
pin_date(c("010101-0101", "111111-111C"))
......
......@@ -3,15 +3,14 @@
\name{pin_sex}
\alias{pin_sex}
\alias{hetu_sex}
\title{Sex From ID}
\title{Extract Sex from Personal Identity Code}
\usage{
pin_sex(pin, allow.temp = TRUE)
hetu_sex(pin, allow.temp = TRUE)
}
\arguments{
\item{pin}{Finnish personal identification number as a character vector,
or vector of identification numbers as a character vectors}
\item{pin}{Finnish personal identity code(s) as a character vector}
\item{allow.temp}{Allow artificial or temporary PINs (personal numbers
900-999). If \code{FALSE} (default), only PINs intended for official
......@@ -21,7 +20,8 @@ use (personal numbers 002-899) are allowed.}
Factor with label 'Male' and 'Female'.
}
\description{
Extract sex from Finnish personal identification number.
Extract sex (as binary) from Finnish personal identification
code.
}
\examples{
pin_sex("010101-010A")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment