get_presidential_events {ArgentinAPI} | R Documentation |
Get Presidential Events in Argentina
Description
This function retrieves the list of presidential events in Argentina from the API 'https://api.argentinadatos.com/v1/eventos/presidenciales'. It returns a structured data frame with the event date, type, and description.
Usage
get_presidential_events()
Details
This function sends a GET request to the ArgentinaDatos API and processes the JSON response into
a structured data frame. The events are not filtered by year and include all available historical data.
If the API does not return a 200 status code, a message is displayed and NULL
is returned.
Value
A data frame (tibble) with the following columns:
-
fecha
: Date of the event (character, format YYYY-MM-DD). -
tipo
: Type of event (e.g., speech, announcement). -
evento
: Description or name of the event.
Note
Requires internet connection. If the API becomes unavailable or changes, the function may need updates.
See Also
Examples
## Not run:
# Retrieve presidential events
events <- get_presidential_events()
print(events)
# View only events after 2020
events %>%
dplyr::filter(fecha >= "2020-01-01")
## End(Not run)