chinese_date {calcal} | R Documentation |
Chinese, Japanese, Korean and Vietnamese calendar dates
Description
The traditional Chinese lunisolar calendar uses a 60-year cycle with 12 months per year. The Japanese, Korean and Vietnamese calendars are almost identical, but with different locations for determining astronomical positions.
Usage
chinese_date(
cycle = integer(),
year = integer(),
month = integer(),
leap_month = logical(),
day = integer()
)
japanese_date(
cycle = integer(),
year = integer(),
month = integer(),
leap_month = logical(),
day = integer()
)
korean_date(
year = integer(),
month = integer(),
leap_month = logical(),
day = integer()
)
vietnamese_date(
cycle = integer(),
year = integer(),
month = integer(),
leap_month = logical(),
day = integer()
)
as_chinese(date)
as_japanese(date)
as_korean(date)
as_vietnamese(date)
Arguments
cycle |
A numeric vector of cycles |
year |
A numeric vector of years within the cycles |
month |
A numeric vector of months |
leap_month |
A logical vector indicating leap months |
day |
A numeric vector of days |
date |
A numeric vector of dates |
Value
A chinese vector object
See Also
Examples
chinese <- new_date(
cycle = 78, year = 42, month = 5, leap_month = FALSE, day = 16:18,
calendar = cal_chinese
)
chinese
chinese_date(78, 42, 5, FALSE, 16:18)
as_date(chinese, calendar = cal_gregorian)
as_date(Sys.Date(), calendar = cal_chinese)
tibble::tibble(
gregorian = gregorian_date(2025, 1, 1) + 0:364,
chinese = as_chinese(gregorian)
)
as_gregorian(chinese_date(78, 41, 12, FALSE, 3:30))
as_chinese(gregorian_date(2025, 1, 1:28))
as_chinese("2016-01-01")
as_chinese(Sys.Date())
[Package calcal version 1.0.0 Index]