get_birth_year: Extract Year of Birth from the Personal Numeric Code

Description Usage Arguments Value Examples

View source: R/get_birth_year.R

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

1

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

1
2
get_birth_year(1940616346114)
get_birth_year(7041218318525)

rocnp documentation built on Nov. 5, 2021, 9:11 a.m.