View source: R/get_argentinian_holidays.R
get_argentinian_holidays | R Documentation |
This function retrieves the list of official holidays in Argentina for a specified year. The data is obtained from the public API at https://api.argentinadatos.com/v1/feriados/. You can append the desired year at the end of the URL. For example: https://api.argentinadatos.com/v1/feriados/2024/ If no year is provided, the function returns holidays for the current year.
get_argentinian_holidays(year = NULL)
year |
An integer representing the year (between 2016 and 2025). Defaults to the current year. |
The function sends a GET request to the ArgentinaDatos API and converts the JSON response into a structured
data frame. It validates the input year and falls back to the current year if none is specified.
If the API does not return a 200 status code, the function will return NULL
and emit a message.
A data frame with the following columns:
fecha
: Date of the holiday (character in YYYY-MM-DD format).
tipo
: Type of holiday (e.g., "inamovible", "trasladable").
nombre
: Name or reason of the holiday.
Requires an active internet connection. If the API is unavailable or its structure changes, the function may need updates.
GET
, fromJSON
## Not run:
# Get holidays for the year 2025
feriados_2025 <- get_argentinian_holidays(2025)
print(feriados_2025)
# Get holidays for the current year
feriados_actual <- get_argentinian_holidays()
View(feriados_actual)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.