get_birth_year {rocnp}R Documentation

Extract Year of Birth from the Personal Numeric Code

Description

This function infers the year of birth based on the code for sex - which is also indicative of the century of birth - and the AA component denoting the final 2 digits of the birth year. The year is returned as string, especially since for residents not born in Romania, there might be two possible valid values for the birth year - in this case the year is returned as "__yy"

Usage

get_birth_year(cnp)

Arguments

cnp

a 13-digit number (or a vector of 13-digit numbers) representing the Personal Numeric Code - CNP

Value

a character vector representing the year of birth (the century is unknown for non-natives)

Examples

get_birth_year(1940616346114)
get_birth_year(7041218318525)

[Package rocnp version 0.1.0 Index]