Package 'CNID'

Title: Get Basic Information from Chinese ID Number
Description: The Chinese ID number contains a lot of information, this package helps you get the date of birth, age, age based on year, gender, region, zodiac, constellation information from the Chinese ID number.
Authors: Xinyuan Chu [aut, cre]
Maintainer: Xinyuan Chu <[email protected]>
License: MIT + file LICENSE
Version: 1.3.1
Built: 2024-08-22 04:47:30 UTC
Source: https://gitlab.com/chuxinyuan/cnid

Help Index


Get age information from ID number

Description

Get age information from ID number, to the day.

Usage

age(id)

Arguments

id

A vector of ID numbers.

Value

Age vector obtained from ID numbers.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
age(id)

Get age information from ID number

Description

Get age information from ID number, only by year, not the specific date.

Usage

age_by_year(id)

Arguments

id

A vector of ID numbers.

Value

Age vector obtained from ID numbers.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
age_by_year(id)

Get date of birth information from ID number

Description

Get date of birth information from ID number.

Usage

birth_date(id)

Arguments

id

A vector of ID numbers.

Value

Date of birth vector obtained from ID numbers.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
birth_date(id)

Get day of birth information from ID number

Description

Get day of birth information from ID number.

Usage

birth_day(id)

Arguments

id

A vector of ID numbers.

Value

Day of birth vector obtained from ID numbers.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
birth_day(id)

Get month of birth information from ID number

Description

Get month of birth information from ID number.

Usage

birth_month(id)

Arguments

id

A vector of ID numbers.

Value

Month of birth vector obtained from ID numbers.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
birth_month(id)

Get year of birth information from ID number

Description

Get year of birth information from ID number.

Usage

birth_year(id)

Arguments

id

A vector of ID numbers.

Value

Year of birth vector obtained from ID numbers.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
birth_year(id)

Check the ID number for logical errors

Description

Check the ID number for logical errors.

Usage

check_id(id)

Arguments

id

A vector of ID numbers.

Value

A vector of TRUE or FALSE.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
check_id(id)

Get full information from ID number

Description

Get full information from ID number.

Usage

cnid_info(id)

Arguments

id

A vector of ID numbers.

Value

A list about date of birth, age, gender, etc. obtained from ID number.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
cnid_info(id)

Get constellation information from ID number

Description

Get constellation information from ID number.

Usage

cstl(id)

Arguments

id

A vector of ID numbers.

Value

Constellation vector obtained from ID numbers.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
cstl(id)

Get gender information from ID number

Description

Get gender information from ID number.

Usage

gender(id)

Arguments

id

A vector of ID numbers.

Value

Gender vector obtained from ID numbers.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
gender(id)

Calculate the number of days in a specified year and month

Description

Calculate the number of days in a specified year and month.

Usage

mdays(month, year = as.integer(format(Sys.Date(), "%Y")))

Arguments

month

A given month, such as 2.

year

A given year, the default is current year.

Value

Days in a specified year and month.

Examples

mdays(2, 2022)

Get region information from ID number

Description

Get region information from ID number.

Usage

region(id)

Arguments

id

A vector of ID numbers.

Value

Region vector obtained from ID numbers.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
region(id)

Calculate the number of days in a specified year

Description

Calculate the number of days in a specified year.

Usage

ydays(year = as.integer(format(Sys.Date(), "%Y")))

Arguments

year

A given year, the default is current year.

Value

Days in a specified year.

Examples

ydays(2022)

Get zodiac information from ID number

Description

Get zodiac information from ID number.

Usage

zodiac(id)

Arguments

id

A vector of ID numbers.

Value

Zodiac vector obtained from ID numbers.

Examples

id = c(
"652801197305161555",
"130206202202291545", 
"110101841125178"
)
zodiac(id)