Learn R Programming

JapanAPIs (version 0.1.1)

get_japan_holidays: Get Official Public Holidays in Japan for a Given Year

Description

Retrieves the list of official public holidays in Japan for a specific year using the Nager.Date public holidays API. This function returns a tibble containing the date of the holiday, the name in the local language (Japanese), and the English name. It is useful for academic, planning, and data analysis purposes. The information is retrieved directly from the Nager.Date API and reflects the current status of holidays for the requested year. The field names returned are consistent with the API structure.

Usage

get_japan_holidays(year)

Value

A tibble with the following columns, or NULL if the API is unavailable:

  • date: Date of the holiday (class Date)

  • local_name: Holiday name in the local language (Japanese)

  • name: Holiday name in English

Arguments

year

An integer indicating the year (e.g., 2024 or 2025).

Examples

Run this code
# \donttest{
# Requires internet connection
result <- get_japan_holidays(2024)
if (!is.null(result)) {
  print(result)
}

result <- get_japan_holidays(2025)
if (!is.null(result)) {
  print(result)
}
# }

Run the code above in your browser using DataLab