| Title: | Validate Lithuanian Personal, Company, VAT and Bank Account Codes |
|---|---|
| Description: | Vectorised checks for Lithuanian personal codes, company codes, VAT numbers and IBANs, and helpers that read the birth date and sex stored in a personal code. The company code check was tested against the open data of the Register Centre <https://www.registrucentras.lt/p/1094>. |
| Authors: | Justas Arbatauskis [aut, cre] |
| Maintainer: | Justas Arbatauskis <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-11-27 17:53:22 UTC |
| Source: | https://github.com/ello-lithuania/ltcodes |
A company code has nine digits and ends in a check digit.
is_company_code(x)is_company_code(x)
x |
A character vector of codes. |
A logical vector of the same length as x; NA input gives NA.
is_company_code(c("123033512", "123033513"))is_company_code(c("123033512", "123033513"))
A Lithuanian IBAN has 20 characters, starts with LT and passes the MOD-97 rule.
is_iban(x)is_iban(x)
x |
A character vector of account numbers. |
A logical vector of the same length as x; NA input gives NA.
is_iban(c("LT121000011101001000", "LT121000011101001001"))is_iban(c("LT121000011101001000", "LT121000011101001001"))
A personal code has 11 digits: the first gives the century and sex, the next six the birth date, and the last is a check digit. Codes that start with 9 carry no date, so only the check digit is tested.
is_personal_code(x)is_personal_code(x)
x |
A character vector of codes. |
A logical vector of the same length as x; NA input gives NA.
is_personal_code(c("33309240064", "33309240164"))is_personal_code(c("33309240064", "33309240164"))
A VAT number has 9 or 12 digits and may start with LT.
is_vat_number(x)is_vat_number(x)
x |
A character vector of numbers. |
A logical vector of the same length as x; NA input gives NA.
is_vat_number(c("LT119511515", "LT119511516"))is_vat_number(c("LT119511515", "LT119511516"))
Reads the date stored in the second to seventh digits. The check digit is not tested.
personal_code_birth_date(x)personal_code_birth_date(x)
x |
A character vector of personal codes. |
A Date vector of the same length as x, with NA where a code holds no valid date.
personal_code_birth_date("33309240064")personal_code_birth_date("33309240064")
Reads the sex stored in the first digit.
personal_code_sex(x)personal_code_sex(x)
x |
A character vector of personal codes. |
A character vector with "M" for first digits 1, 3 and 5, "F" for 2, 4 and 6, and NA otherwise.
personal_code_sex("33309240064")personal_code_sex("33309240064")