Learn R Programming

calcal (version 1.0.0)

chinese_date: 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)

Value

A chinese vector object

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

See Also

cal_chinese, chinese_new_year

Examples

Run this code
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())

Run the code above in your browser using DataLab