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-11-01 11:14:47 UTC |
Source: | https://gitlab.com/chuxinyuan/cnid |
Get age information from ID number, to the day.
age(id)
age(id)
id |
A vector of ID numbers. |
Age vector obtained from ID numbers.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) age(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) age(id)
Get age information from ID number, only by year, not the specific date.
age_by_year(id)
age_by_year(id)
id |
A vector of ID numbers. |
Age vector obtained from ID numbers.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) age_by_year(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) age_by_year(id)
Get date of birth information from ID number.
birth_date(id)
birth_date(id)
id |
A vector of ID numbers. |
Date of birth vector obtained from ID numbers.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) birth_date(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) birth_date(id)
Get day of birth information from ID number.
birth_day(id)
birth_day(id)
id |
A vector of ID numbers. |
Day of birth vector obtained from ID numbers.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) birth_day(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) birth_day(id)
Get month of birth information from ID number.
birth_month(id)
birth_month(id)
id |
A vector of ID numbers. |
Month of birth vector obtained from ID numbers.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) birth_month(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) birth_month(id)
Get year of birth information from ID number.
birth_year(id)
birth_year(id)
id |
A vector of ID numbers. |
Year of birth vector obtained from ID numbers.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) birth_year(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) birth_year(id)
Check the ID number for logical errors.
check_id(id)
check_id(id)
id |
A vector of ID numbers. |
A vector of TRUE or FALSE.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) check_id(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) check_id(id)
Get full information from ID number.
cnid_info(id)
cnid_info(id)
id |
A vector of ID numbers. |
A list about date of birth, age, gender, etc. obtained from ID number.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) cnid_info(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) cnid_info(id)
Get constellation information from ID number.
cstl(id)
cstl(id)
id |
A vector of ID numbers. |
Constellation vector obtained from ID numbers.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) cstl(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) cstl(id)
Get gender information from ID number.
gender(id)
gender(id)
id |
A vector of ID numbers. |
Gender vector obtained from ID numbers.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) gender(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) gender(id)
Calculate the number of days in a specified year and month.
mdays(month, year = as.integer(format(Sys.Date(), "%Y")))
mdays(month, year = as.integer(format(Sys.Date(), "%Y")))
month |
A given month, such as 2. |
year |
A given year, the default is current year. |
Days in a specified year and month.
mdays(2, 2022)
mdays(2, 2022)
Get region information from ID number.
region(id)
region(id)
id |
A vector of ID numbers. |
Region vector obtained from ID numbers.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) region(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) region(id)
Calculate the number of days in a specified year.
ydays(year = as.integer(format(Sys.Date(), "%Y")))
ydays(year = as.integer(format(Sys.Date(), "%Y")))
year |
A given year, the default is current year. |
Days in a specified year.
ydays(2022)
ydays(2022)
Get zodiac information from ID number.
zodiac(id)
zodiac(id)
id |
A vector of ID numbers. |
Zodiac vector obtained from ID numbers.
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) zodiac(id)
id = c( "652801197305161555", "130206202202291545", "110101841125178" ) zodiac(id)