R/pin_sex.R

Defines functions pin_sex

Documented in pin_sex

#' @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
#' @seealso \code{\link{hetu}} For general information extraction
#' @examples
#' pin_sex("010101-010A")
#' @export
pin_sex <- function(pin, allow.temp = TRUE) {

  return(hetu(pin, extract = "sex", allow.temp = allow.temp))

}

#' @rdname pin_sex
#' @examples
#' hetu_sex("010101-010A")
#' @export
hetu_sex <- pin_sex

Try the hetu package in your browser

Any scripts or data that you put into this service are public.

hetu documentation built on May 22, 2022, 1:05 a.m.